Fix resizing crash when currentPage() is null

Sentry:
https://sentry.io/owncloud/desktop-win-and-mac/issues/425331770/
This commit is contained in:
Christian Kamm 2018-01-09 11:41:39 +01:00 committed by ckamm
parent 883deb1c5d
commit cdd8d10940

View file

@ -568,10 +568,12 @@ void FolderWizard::resizeEvent(QResizeEvent *event)
QWizard::resizeEvent(event); QWizard::resizeEvent(event);
// workaround for QTBUG-22819: when the error label word wrap, the minimum height is not adjusted // workaround for QTBUG-22819: when the error label word wrap, the minimum height is not adjusted
int hfw = currentPage()->heightForWidth(currentPage()->width()); if (auto page = currentPage()) {
if (currentPage()->height() < hfw) { int hfw = page->heightForWidth(page->width());
currentPage()->setMinimumSize(currentPage()->minimumSizeHint().width(), hfw); if (page->height() < hfw) {
setTitleFormat(titleFormat()); // And another workaround for QTBUG-3396 page->setMinimumSize(page->minimumSizeHint().width(), hfw);
setTitleFormat(titleFormat()); // And another workaround for QTBUG-3396
}
} }
} }