From 1ce3d33d83524a31b8357802602059f975e66851 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Sun, 29 Jan 2012 17:50:00 +0000 Subject: [PATCH] fix TRxHistoryNavigator with empty Back or Forward buttons git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2273 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/rxhistorynavigator.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/rx/rxhistorynavigator.pas b/components/rx/rxhistorynavigator.pas index b1ca0f49a..1ed51a173 100644 --- a/components/rx/rxhistorynavigator.pas +++ b/components/rx/rxhistorynavigator.pas @@ -190,8 +190,14 @@ end; procedure TRxHistoryNavigator.EnableAction(ActName: byte; Enable: boolean); begin if First=nil then Enable:=false; - if ActName = 0 then (FBackBtnItem.Action as TAction).Enabled:=Enable - else (FForwardBtnItem.Action as TAction).Enabled:=Enable + if ActName = 0 then + begin + if Assigned(FBackBtnItem) then + (FBackBtnItem.Action as TAction).Enabled:=Enable + end + else + if Assigned(FForwardBtnItem) then + (FForwardBtnItem.Action as TAction).Enabled:=Enable end; procedure TRxHistoryNavigator.BackProc(Sender: TObject);