Fix crash when creating guide and no pages in layout

This commit is contained in:
Nyall Dawson 2017-07-29 11:18:40 +10:00
parent 2f49329634
commit 04e6529efd

View File

@ -585,6 +585,9 @@ void QgsLayoutRuler::mouseMoveEvent( QMouseEvent *event )
QgsLayout *layout = mView->currentLayout();
int pageNo = layout->pageCollection()->pageNumberForPoint( displayPos );
QgsLayoutItemPage *page = layout->pageCollection()->page( pageNo );
if ( !page )
return;
QPen linePen = mGuideItem->pen();
// if guide preview is outside a page draw it a lot fainter, to indicate it's invalid
if ( !layout->pageCollection()->pageAtPoint( displayPos ) )