summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2011-09-13 15:33:31 +0200
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2011-09-13 17:30:28 +0200
commit71bcd941d577097ca99900554386c9f12d4353e3 (patch)
treec0680974127ea16119c800b1589af8c3088d4211 /src
parent695ef14f443ef992f62203949fc1565b11fdf621 (diff)
downloadqt4-tools-71bcd941d577097ca99900554386c9f12d4353e3.tar.gz
Add missing checks for httpReply in QNetworkHttpBackend.
httpReply is not guaranteed to be non-null. Adding missing checks for methods that can be called from outside the class. Reviewed-By: Peter Hartmann
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index abef8ab56a..aa477fbd4d 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -737,7 +737,7 @@ void QNetworkAccessHttpBackend::readFromHttp()
void QNetworkAccessHttpBackend::replyFinished()
{
- if (httpReply->bytesAvailable())
+ if (!httpReply || httpReply->bytesAvailable())
// we haven't read everything yet. Wait some more.
return;
@@ -788,6 +788,9 @@ void QNetworkAccessHttpBackend::checkForRedirect(const int statusCode)
void QNetworkAccessHttpBackend::replyHeaderChanged()
{
+ if (!httpReply)
+ return;
+
setAttribute(QNetworkRequest::HttpPipeliningWasUsedAttribute, httpReply->isPipeliningUsed());
// reconstruct the HTTP header
@@ -1128,7 +1131,7 @@ bool QNetworkAccessHttpBackend::canResume() const
return false;
// Can only resume if server/resource supports Range header.
- if (httpReply->headerField("Accept-Ranges", "none") == "none")
+ if (!httpReply || httpReply->headerField("Accept-Ranges", "none") == "none")
return false;
// We only support resuming for byte ranges.