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>
This commit is contained in:
Tor Arne Vestbø 2017-08-23 15:22:35 +02:00
parent 515b905150
commit 7b1a3ba027

View File

@ -111,6 +111,7 @@ public:
template <typename X> X as() const { return reinterpret_cast<X>(type); }
static QCFType constructFromGet(const T &t)
{
if (t)
CFRetain(t);
return QCFType<T>(t);
}