From 561aeb6b8f7bc4ddb5e6d3e5cbc0ddc9cd344aa9 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 2 Nov 2010 16:53:38 +0100 Subject: Fix crash check the global network proxy for 0 before dereferencing Reviewed-by: Robert Griebl --- src/network/kernel/qnetworkproxy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index bc5a025..d9d5918 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -426,7 +426,8 @@ template<> void QSharedDataPointer::detach() QNetworkProxy::QNetworkProxy() : d(0) { - globalNetworkProxy()->init(); + if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy()) + globalProx->init(); } /*! @@ -441,7 +442,8 @@ QNetworkProxy::QNetworkProxy(ProxyType type, const QString &hostName, quint16 po const QString &user, const QString &password) : d(new QNetworkProxyPrivate(type, hostName, port, user, password)) { - globalNetworkProxy()->init(); + if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy()) + globalProx->init(); } /*! -- cgit v0.12