From b66ff0b6ac5351c59ca980500c1181ef37fa380e Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:34:58 +0800 Subject: [PATCH] Apply suggestions from code review --- compiler/semexprs.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index f4ff443069..5b40ef2ee6 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -2450,7 +2450,7 @@ proc semQuoteAst(c: PContext, n: PNode): PNode = # don't allow templates to capture syms without backticks let oldScope = c.currentScope # c.currentScope = PScope(parent: nil, symbols: initStrTable(), depthLevel: 0) - if c.p.owner.kind in routineKinds: + if c.p.owner != nil and c.p.owner.kind in routineKinds: # skips the current routine scopes block exitLabel: while c.currentScope != nil: