summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qexception.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qexception.cpp')
-rw-r--r--src/corelib/thread/qexception.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp
index e45e6f4895..62c2b608d8 100644
--- a/src/corelib/thread/qexception.cpp
+++ b/src/corelib/thread/qexception.cpp
@@ -171,7 +171,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)
@@ -187,6 +187,8 @@ ExceptionHolder::~ExceptionHolder()
QException *ExceptionHolder::exception() const
{
+ if (!base)
+ return Q_NULLPTR;
return base->exception;
}