summaryrefslogtreecommitdiffstats
path: root/src/core/api/qwebenginedownloadrequest.cpp
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2023-12-06 10:40:31 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2023-12-07 22:03:17 +0100
commit3c6056d062c3b94ff9031cb4931a59de06137d1b (patch)
tree36b35012801edf129dc6935f82bdac92aa4cf2cb /src/core/api/qwebenginedownloadrequest.cpp
parent8ed67489d0fc1bf95f74bc4e7091bbdad6f90082 (diff)
Fix unconditional pointer access in QWebEngineDownloadRequest::page
The adapterClient pointer in QWebEngineDownloadRequestPrivate can be initialized to a nullptr in some scenarios, but was used without checking if the pointer is actually set. Pick-to: 6.6 6.5 Task-number: QTBUG-119763 Change-Id: I7a8653e7f0f5d920dbe69785fb3ce3518c96cc24 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/api/qwebenginedownloadrequest.cpp')
-rw-r--r--src/core/api/qwebenginedownloadrequest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp
index 07ea37600..cbf46b448 100644
--- a/src/core/api/qwebenginedownloadrequest.cpp
+++ b/src/core/api/qwebenginedownloadrequest.cpp
@@ -607,7 +607,7 @@ QString QWebEngineDownloadRequest::interruptReasonString() const
QWebEnginePage *QWebEngineDownloadRequest::page() const
{
Q_D(const QWebEngineDownloadRequest);
- if (d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
+ if (d->adapterClient && d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
return const_cast<QWebEnginePage *>(static_cast<const QWebEnginePage *>(d->adapterClient->holdingQObject()));
return nullptr;
}