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(); } }