Skip to content

Commit

Permalink
fixes a nimsuggest crash on init
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed Feb 10, 2024
1 parent ae2cdce commit b75d43b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/sempass2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ proc getObjDepth(t: PType): (int, ItemId) =

proc collectObjectTree(graph: ModuleGraph, n: PNode) =
for section in n:
if section.kind == nkTypeDef and section[^1].kind in {nkObjectTy, nkRefTy, nkPtrTy}:
if section.kind == nkTypeDef and section[^1].kind in {nkObjectTy, nkRefTy, nkPtrTy} and section[^1].typ != nil:
let typ = section[^1].typ.skipTypes(skipPtrs)
if typ.kind == tyObject and typ.baseClass != nil:
let (depthLevel, root) = getObjDepth(typ)
Expand Down

0 comments on commit b75d43b

Please sign in to comment.