Check if method field is a string

This commit is contained in:
kdeme 2019-05-09 15:31:28 +02:00 committed by zah
parent 27dea58c4d
commit 707567c7ab
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ proc checkJsonState*(line: string,
let jVer = node{jsonRpcField}
if jVer != nil and jVer.kind != JNull and jVer != %"2.0":
return some((rjeVersionError, ""))
if not node.hasKey(methodField):
if not node.hasKey(methodField) or node[methodField].kind != JString:
return some((rjeNoMethod, ""))
if not node.hasKey(paramsField):
return some((rjeNoParams, ""))