From eb30f69454a1080194c237eb5f64b8116c329af0 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 29 Mar 2014 23:02:55 +0100 Subject: [PATCH] Fix crash in DiagnosticInformation(). Refs #5870 --- lib/base/exception.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/base/exception.h b/lib/base/exception.h index 872f69fd4..79783c5e7 100644 --- a/lib/base/exception.h +++ b/lib/base/exception.h @@ -61,19 +61,22 @@ String DiagnosticInformation(const T& ex, StackTrace *stack = NULL, ContextTrace if (boost::get_error_info(ex) == NULL) { result << std::endl; + if (!stack) + stack = GetLastExceptionStack(); + if (stack) result << *stack; - else - result << *GetLastExceptionStack(); + } if (boost::get_error_info(ex) == NULL) { result << std::endl; + if (!context) + context = GetLastExceptionContext(); + if (context) result << *context; - else - result << *GetLastExceptionContext(); } } -- 2.40.0