mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 20:18:17 +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
|
||||
CurNode: TTreeNode;
|
||||
Branch: TTreeFilterBranch;
|
||||
AnObject: TObject;
|
||||
begin
|
||||
Result:=nil;
|
||||
if LazProject=nil then exit;
|
||||
@ -791,7 +792,9 @@ begin
|
||||
then begin
|
||||
Branch:=FilterEdit.GetExistingBranch(CurNode.Parent);
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user