summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-29 10:30:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-30 16:32:19 +0000
commit8123368cc00e4eba94016218c91b191efd3d8634 (patch)
treeaa03bfd161ec65516bd9867ec2751bbfee118753 /src
parent1a4132a29f0f7b77fb45561b01ed63365164168a (diff)
Fix seeking on null QIODevice in pathological corner case
Change-Id: I5b242bc27f27a844d9d2fe0725e2a1f48e50b25b Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io> (cherry picked from commit d9b92b0fc9209733d332ac6ae145833e6b1153f2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/core/net/url_request_custom_job_proxy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp
index f734db645..b57583341 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -96,7 +96,7 @@ void URLRequestCustomJobProxy::reply(std::string mimeType, QIODevice *device)
if (m_client->m_device && !m_client->m_device->isReadable())
m_client->m_device->open(QIODevice::ReadOnly);
- if (m_client->m_firstBytePosition > 0)
+ if (m_client->m_device && m_client->m_firstBytePosition > 0)
m_client->m_device->seek(m_client->m_firstBytePosition);
qint64 deviceSize = m_client->m_device ? m_client->m_device->size() : -1;