summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2023-12-29 12:27:55 -0700
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-12-31 15:30:08 +0000
commitdbf2cfefa5f7f4bb1a7e492d058fb4048ab17f10 (patch)
tree664245e1ca9a117a66d9e205a39ff3ad2e23b132
parent72c167ff52c497f80269c2a1d6c9fd4b9c120f0a (diff)
Fix crash in QQuickPdfSearchModel::setCurrentPage()
Found while testing the single-page example with a fix for QTBUG-119776: m_quickDocument is null until we open a document. Pick-to: 6.5 6.2 Task-number: QTBUG-119776 Change-Id: I548d549d4fc63d1a40b141f728c0c58d3db1178d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit a21be3a9fe6747e6d4da762a4350ff024f94547c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ede8d4b6e4ea6ce1f4352346b672e54c3b695a5b)
-rw-r--r--src/pdfquick/qquickpdfsearchmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pdfquick/qquickpdfsearchmodel.cpp b/src/pdfquick/qquickpdfsearchmodel.cpp
index ca33a6dc6..21fa1a70b 100644
--- a/src/pdfquick/qquickpdfsearchmodel.cpp
+++ b/src/pdfquick/qquickpdfsearchmodel.cpp
@@ -199,7 +199,7 @@ QList<QPolygonF> QQuickPdfSearchModel::boundingPolygonsOnPage(int page)
*/
void QQuickPdfSearchModel::setCurrentPage(int currentPage)
{
- if (m_currentPage == currentPage)
+ if (m_currentPage == currentPage || !document())
return;
const auto pageCount = document()->document()->pageCount();