Don't break on empty stack

This commit is contained in:
Jérôme Alet
2022-04-15 08:12:02 +11:00
parent 2f423117c1
commit d82e291688

View File

@@ -84,6 +84,7 @@ def check(conf, token, prev, next, nextnext, context):
elif isinstance(token, (yaml.BlockEndToken,
yaml.FlowMappingEndToken,
yaml.FlowSequenceEndToken)):
if len(context['stack']) > 0:
context['stack'].pop()
elif (isinstance(token, yaml.KeyToken) and
isinstance(next, yaml.ScalarToken)):