mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-11 11:38:13 +02:00
IDE: check if object is TPkgDependency, otherwise we'll crash. issue #21338
git-svn-id: trunk@35530 -
This commit is contained in:
parent
340a4ed173
commit
3c600e2263
@ -782,6 +782,7 @@ function TProjectInspectorForm.GetSelectedDependency: TPkgDependency;
|
|||||||
var
|
var
|
||||||
CurNode: TTreeNode;
|
CurNode: TTreeNode;
|
||||||
Branch: TTreeFilterBranch;
|
Branch: TTreeFilterBranch;
|
||||||
|
AnObject: TObject;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
if LazProject=nil then exit;
|
if LazProject=nil then exit;
|
||||||
@ -791,7 +792,9 @@ begin
|
|||||||
then begin
|
then begin
|
||||||
Branch:=FilterEdit.GetExistingBranch(CurNode.Parent);
|
Branch:=FilterEdit.GetExistingBranch(CurNode.Parent);
|
||||||
Assert(Assigned(Branch));
|
Assert(Assigned(Branch));
|
||||||
Result:=Branch.GetData(CurNode.Index) as TPkgDependency;
|
AnObject := Branch.GetData(CurNode.Index);
|
||||||
|
if (AnObject <> nil) and (AnObject is TPkgDependency) then
|
||||||
|
Result := TPkgDependency(AnObject);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user