Avoid dereferencing nullptr

Change-Id: Id9558fa1db6a7a8f29149e26c761450f58b74b81
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Mårten Nordheim 2017-08-16 10:45:41 +02:00
parent b5d762ae87
commit 7c4c93a76a

View File

@ -691,7 +691,7 @@ void QNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar)
if (d->cookieJar && d->cookieJar->parent() == this) if (d->cookieJar && d->cookieJar->parent() == this)
delete d->cookieJar; delete d->cookieJar;
d->cookieJar = cookieJar; d->cookieJar = cookieJar;
if (thread() == cookieJar->thread()) if (cookieJar && thread() == cookieJar->thread())
d->cookieJar->setParent(this); d->cookieJar->setParent(this);
} }
} }