diff --git a/lib/system.nim b/lib/system.nim index 2c5790d5ee..cb211e6a9d 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -3412,9 +3412,10 @@ elif hasAlloc: {.push stack_trace:off, profiler:off.} proc add*(x: var string, y: cstring) = var i = 0 - while y[i] != '\0': - add(x, y[i]) - inc(i) + if y != nil: + while y[i] != '\0': + add(x, y[i]) + inc(i) {.pop.} when defined(nimvarargstyped):