mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Fix reading empty token stack with a node with properties but no scalar.
E.g. `!2`.
This commit is contained in:
@@ -79,6 +79,12 @@ void SingleDocParser::HandleNode(EventHandler& eventHandler) {
|
||||
if (!anchor_name.empty())
|
||||
eventHandler.OnAnchor(mark, anchor_name);
|
||||
|
||||
// after parsing properties, an empty node is again a possibility
|
||||
if (m_scanner.empty()) {
|
||||
eventHandler.OnNull(mark, anchor);
|
||||
return;
|
||||
}
|
||||
|
||||
const Token& token = m_scanner.peek();
|
||||
|
||||
if (token.type == Token::PLAIN_SCALAR && IsNullString(token.value)) {
|
||||
|
Reference in New Issue
Block a user