diff --git a/src/printsupport/widgets/qprintpreviewwidget.cpp b/src/printsupport/widgets/qprintpreviewwidget.cpp index 46d93c315e..f297c4448f 100644 --- a/src/printsupport/widgets/qprintpreviewwidget.cpp +++ b/src/printsupport/widgets/qprintpreviewwidget.cpp @@ -401,7 +401,7 @@ void QPrintPreviewWidgetPrivate::generatePreview() pictures = printer->d_func()->previewPages(); populateScene(); // i.e. setPreviewPrintedPictures() e.l. layoutPages(); - curPage = qBound(1, curPage, pages.count()); + curPage = pages.count() > 0 ? qBound(1, curPage, pages.count()) : 1; if (fitting) _q_fit(); emit q->previewChanged();