From 2f394e84881ba663f1747a66891f994a54e5fdd4 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 15 Mar 2015 13:06:25 +0100 Subject: Fix crash when an undefined annotation is met in the input --- src/core/parser/stack/Stack.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/parser/stack/Stack.cpp') diff --git a/src/core/parser/stack/Stack.cpp b/src/core/parser/stack/Stack.cpp index 436d3a5..90735df 100644 --- a/src/core/parser/stack/Stack.cpp +++ b/src/core/parser/stack/Stack.cpp @@ -869,8 +869,15 @@ void StackImpl::handleAnnotationStartEnd(const Variant &name, // Call the startAnnotation method of the newly created handler, store the // valid flag HandlerInfo &info = currentInfo(); - info.valid = handler->startAnnotation(args); + info.valid = false; + try { + info.valid = handler->startAnnotation(args); + } catch (LoggableException ex) { + logger().log(ex); + } info.range = range; + + // End the handler directly if this is an annotation end if (type == HandlerType::ANNOTATION_END) { endCurrentHandler(); } -- cgit v1.2.3