From 3c600e22636c80f68113f7a5aa9b105c33798ca5 Mon Sep 17 00:00:00 2001 From: zeljko Date: Tue, 21 Feb 2012 11:24:21 +0000 Subject: [PATCH] IDE: check if object is TPkgDependency, otherwise we'll crash. issue #21338 git-svn-id: trunk@35530 - --- ide/projectinspector.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ide/projectinspector.pas b/ide/projectinspector.pas index 747dd1c2be..09e65b0f0c 100644 --- a/ide/projectinspector.pas +++ b/ide/projectinspector.pas @@ -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;