From 208b018f6b807f76053e195cf8fbfc1f2f67f7b4 Mon Sep 17 00:00:00 2001 From: itsumura-h <39766805+itsumura-h@users.noreply.github.com> Date: Thu, 5 Dec 2019 18:28:47 +0900 Subject: [PATCH] fix db_mysql getRow() when column is null error raised (#12806) [backport] * fix db_mysql getRow() * added if y == nil [backport] --- lib/system.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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):