summaryrefslogtreecommitdiff
path: root/qt4
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2011-07-20 00:17:49 +0200
committerAlbert Astals Cid <aacid@kde.org>2011-07-20 00:17:49 +0200
commitac566c887ffae9d384587f7587609642aef7a016 (patch)
tree33581782d35d3cc9caccaf23f1c319e4d492728b /qt4
parent6ad95e7b8b9766aa19f01f06f02eb430e4a4a899 (diff)
Do not crash if can not get page 0 for some reason
Diffstat (limited to 'qt4')
-rw-r--r--qt4/tests/test-poppler-qt4.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/qt4/tests/test-poppler-qt4.cpp b/qt4/tests/test-poppler-qt4.cpp
index 2f0f924e..503b35a8 100644
--- a/qt4/tests/test-poppler-qt4.cpp
+++ b/qt4/tests/test-poppler-qt4.cpp
@@ -209,8 +209,11 @@ int main( int argc, char **argv )
}
Poppler::Page *page = doc->page(0);
- qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " << page->pageSize().height()/72 << "inches";
- delete page;
+ if (page)
+ {
+ qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " << page->pageSize().height()/72 << "inches";
+ delete page;
+ }
if (argc == 2 || (argc == 3 && strcmp(argv[2], "-arthur") == 0) || (argc == 3 && strcmp(argv[2], "-textRects") == 0))
{