Fixed bug in presenter

This commit is contained in:
Felix Krause 2016-01-07 11:58:33 +01:00
parent cf5f614b21
commit f5627254f7
1 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ proc present*(s: YamlStream, target: Stream, tagLib: YamlTagLibrary,
nextState = if length <= 60: dFlowSequenceStart else:
dBlockSequenceItem
of ypsJson:
if levels[levels.high] in
if levels.len > 0 and levels[levels.high] in
[dFlowImplicitMapStart, dFlowImplicitMapValue]:
raise newException(YamlPresenterJsonError,
"Cannot have sequence as map key in JSON output!")