From cf1428f68037b818cce655ddc9b76ab33d0441e1 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 25 Aug 2010 15:09:18 +0200 Subject: docview: Added some extra error checking code to prevent exception errors. --- docview/src/frm_main.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'docview') diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index a6e8a8b6..a7a4d8cc 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -881,7 +881,8 @@ begin // the "no results" place holder exit; Topic := lbSearchResults.Items.Objects[lbSearchResults.FocusItem] as TTopic; - DisplayTopic( Topic ); + if Topic <> nil then + DisplayTopic(Topic); end; procedure TMainForm.NavigateToHistoryIndex(AIndex: integer); @@ -1802,8 +1803,16 @@ begin //writeln('-----------------------------'); RichView.AddText(PChar(lText)); + if CurrentTopic.ShowInContents then + begin tvContents.Selection := tvContents.RootNode.FindSubNode(CurrentTopic, True); tvContents.Invalidate; + end + else + begin + tvContents.Selection := nil; + tvContents.Invalidate; + end; SaveNavigatePoint; UpdateLocationPanel; end; -- cgit v1.2.3-70-g09d2