summaryrefslogtreecommitdiff
path: root/src/core/parser/stack/Stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/parser/stack/Stack.cpp')
-rw-r--r--src/core/parser/stack/Stack.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/parser/stack/Stack.cpp b/src/core/parser/stack/Stack.cpp
index 07f7d8c..08f86e5 100644
--- a/src/core/parser/stack/Stack.cpp
+++ b/src/core/parser/stack/Stack.cpp
@@ -276,7 +276,7 @@ void Stack::endOverdueHandlers()
HandlerInfo &info = stack.back();
// Abort if this handler currently is inside a field
- if (info.inField || !info.hadDefaultField) {
+ if (info.inField || (!info.hadDefaultField && info.valid)) {
return;
}
@@ -291,8 +291,9 @@ bool Stack::ensureHandlerIsInField()
// try to start a default field
HandlerInfo &info = currentInfo();
if (!info.inField && info.handler != nullptr) {
- // Abort if the element already had a default field
- if (info.hadDefaultField) {
+ // Abort if the element already had a default field or the handler is
+ // not valid
+ if (info.hadDefaultField || !info.valid) {
return false;
}