diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index 6c2433534..51ee848f2 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -28,6 +28,12 @@ inline std::string toString(uint8_t num) { } inline std::string toString(std::exception_ptr error) { + assert(error); + + if (!error) { + return "(null)"; + } + try { std::rethrow_exception(error); } catch (const std::exception& ex) {