From 90694bc3b9d0c1d36e9b1012c68a70276ed27fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Mon, 11 Mar 2019 17:56:55 +0100 Subject: [PATCH] Guard diagnostic_information against null what() --- include/boost/exception/diagnostic_information.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp index b94ca44..ad22735 100644 --- a/include/boost/exception/diagnostic_information.hpp +++ b/include/boost/exception/diagnostic_information.hpp @@ -161,7 +161,7 @@ boost core::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n'; #endif if( with_what && se && verbose ) - tmp << "std::exception::what: " << wh << '\n'; + tmp << "std::exception::what: " << (wh ? wh : "(null)") << '\n'; if( be ) if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) ) if( *s )