even more strict isNil handling for strings/seqs in order to detect bugs

This commit is contained in:
Araq 2018-08-22 12:35:46 +02:00
commit 64517445ea
36 changed files with 193 additions and 245 deletions

View file

@ -98,8 +98,7 @@ proc storeAny(s: Stream, a: Any, stored: var IntSet) =
of akProc, akPointer, akCString: s.write($a.getPointer.ptrToInt)
of akString:
var x = getString(a)
if isNil(x): s.write("null")
elif x.validateUtf8() == -1: s.write(escapeJson(x))
if x.validateUtf8() == -1: s.write(escapeJson(x))
else:
s.write("[")
var i = 0