diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-25 15:09:18 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-25 15:09:18 +0200 |
commit | cf1428f68037b818cce655ddc9b76ab33d0441e1 (patch) | |
tree | 5835a6df8b3256910251221e7ac9e94da90dcbb5 /docview | |
parent | 695e46e5bf96e49bcdda2c5fac43282a137c8d1d (diff) | |
download | fpGUI-cf1428f68037b818cce655ddc9b76ab33d0441e1.tar.xz |
docview: Added some extra error checking code to prevent exception errors.
Diffstat (limited to 'docview')
-rw-r--r-- | docview/src/frm_main.pas | 11 |
1 files changed, 10 insertions, 1 deletions
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; |