From 3fb7dc3c0ed2b2a4ab6114d1a7212b36fc22ee88 Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 20 Apr 2010 08:39:42 +0000 Subject: [PATCH] IDE: fixed crash on DoCommand git-svn-id: trunk@24730 - --- ide/main.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ide/main.pp b/ide/main.pp index 43be9df5d1..1c1cfc4141 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -16690,6 +16690,7 @@ procedure TMainIDE.DoCommand(ACommand: integer); var ActiveSourceEditor: TSourceEditor; ActiveUnitInfo: TUnitInfo; + AForm: TCustomForm; begin GetCurrentUnit(ActiveSourceEditor,ActiveUnitInfo); case FDisplayState of @@ -16697,8 +16698,11 @@ begin if Assigned(ActiveSourceEditor) then ActiveSourceEditor.DoEditorExecuteCommand(ACommand); dsForm: // send command to form editor - if Assigned(ActiveUnitInfo) then - TDesigner(GetDesignerFormOfSource(ActiveUnitInfo,False).Designer).DoCommand(ACommand); + if Assigned(ActiveUnitInfo) then begin + AForm:=GetDesignerFormOfSource(ActiveUnitInfo,False); + if (AForm<>nil) and (AForm.Designer<>nil) then + TDesigner(AForm.Designer).DoCommand(ACommand); + end; end; end;