mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
fixes a nimsuggest crash on init (#23300)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user