mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 16:40:48 +02:00
IDE: fixed crash on DoCommand
git-svn-id: trunk@24730 -
This commit is contained in:
parent
6d5e6b7c52
commit
3fb7dc3c0e
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user