From d9b92b0fc9209733d332ac6ae145833e6b1153f2 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Sep 2021 10:30:28 +0200 Subject: Fix seeking on null QIODevice in pathological corner case Pick-to: 6.2 Change-Id: I5b242bc27f27a844d9d2fe0725e2a1f48e50b25b Reviewed-by: Kirill Burtsev --- src/core/net/url_request_custom_job_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3