diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp index 04a03b86233..cecd69c273b 100644 --- a/src/corelib/thread/qexception.cpp +++ b/src/corelib/thread/qexception.cpp @@ -165,7 +165,7 @@ public: }; ExceptionHolder::ExceptionHolder(QException *exception) -: base(new Base(exception)) {} +: base(exception ? new Base(exception) : Q_NULLPTR) {} ExceptionHolder::ExceptionHolder(const ExceptionHolder &other) : base(other.base) @@ -181,6 +181,8 @@ ExceptionHolder::~ExceptionHolder() QException *ExceptionHolder::exception() const { + if (!base) + return Q_NULLPTR; return base->exception; }