summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2020-06-22 19:33:01 +0200
committerAlbert Astals Cid <aacid@kde.org>2020-06-22 19:35:53 +0200
commit94e00cbe5481a02e84fc29974c7d0089d847d3eb (patch)
tree9a74f85d6d78e8fc8aa84e0583bdfea2a0e04b67
parentebb77e7a1fbb83c3ab7f9cd948d950bb5243f7c3 (diff)
qt5: demo: Fix crash on broken files
-rw-r--r--qt5/demos/thumbnails.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt5/demos/thumbnails.cpp b/qt5/demos/thumbnails.cpp
index d44b38ad..e5f6049c 100644
--- a/qt5/demos/thumbnails.cpp
+++ b/qt5/demos/thumbnails.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009, Shawn Rutledge <shawn.t.rutledge@gmail.com>
* Copyright (C) 2009, Pino Toscano <pino@kde.org>
+ * Copyright (C) 2020, Albert Astals Cid <aacid@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +49,7 @@ void ThumbnailsDock::fillInfo()
QSize maxSize;
for (int i = 0; i < num; ++i) {
const Poppler::Page *page = document()->page(i);
- const QImage image = page->thumbnail();
+ const QImage image = page ? page->thumbnail() : QImage();
if (!image.isNull()) {
QListWidgetItem *item = new QListWidgetItem();
item->setText(QString::number(i + 1));