Codetools: fix crash when trying to add declaration for "foo := unit1;" Patch by WooBean007

(cherry picked from commit ba0c38e2b4)
This commit is contained in:
Martin 2024-02-13 10:59:37 +01:00
parent 972e988e00
commit 60d9e7d2d9

View File

@ -13592,8 +13592,9 @@ begin
FindContext:=ExprType.Context;
// ToDo: PPU, DCU
if FindContext.Node.Parent.Desc=ctnTypeDefinition then
if (FindContext.Node<>nil) and (FindContext.Node.Parent<>nil) and
(FindContext.Node.Parent.Desc=ctnTypeDefinition)
then
FindContext.Node:=FindContext.Node.Parent;
case FindContext.Node.Desc of