summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-08-23 15:22:35 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-08-24 22:20:50 +0000
commit7b1a3ba027cf729e2bbc205801595a1d82b75a27 (patch)
tree49f4eac8a60fcd4a5406d74ef2603b056b8cd052 /src
parent515b9051505d61af6be0eba87616c7281ee4ce62 (diff)
Fix QCFType::constructFromGet() crash when passed a nullptr
Change-Id: I83cbbb47af8580fa67cbc75fee07bc1e123895eb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qcore_mac_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index d0edef33a2..b87babc07a 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -111,7 +111,8 @@ public:
template <typename X> X as() const { return reinterpret_cast<X>(type); }
static QCFType constructFromGet(const T &t)
{
- CFRetain(t);
+ if (t)
+ CFRetain(t);
return QCFType<T>(t);
}
protected: