From 3d80fcb8c6ff1e03922f517681efad65d79563fb Mon Sep 17 00:00:00 2001 From: transfuturist Date: Sat, 16 May 2015 17:50:01 -0700 Subject: [PATCH] Add value check for NimNode items --- lib/core/macros.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 48e4566b3..41998250e 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -708,9 +708,10 @@ proc `$`*(node: NimNode): string {.compileTime.} = proc ident*(name: string): NimNode {.compileTime,inline.} = newIdentNode(name) ## Create a new ident node from a string -iterator items*(n: NimNode): NimNode {.inline.}= - for i in 0 .. high(n): - yield n[i] +iterator items*(n: NimNode): NimNode {.inline.} = + if n[0] != nil: + for i in 0 .. high(n): + yield n[i] {.deprecated: [children: items].}