IDE: fixed crash on DoCommand

git-svn-id: trunk@24730 -
This commit is contained in:
mattias 2010-04-20 08:39:42 +00:00
parent 6d5e6b7c52
commit 3fb7dc3c0e

View File

@ -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;