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

This commit is contained in:
Martin 2024-02-13 10:59:37 +01:00
parent e72f2533e7
commit ba0c38e2b4

View File

@ -13778,8 +13778,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