Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash when creating guide and no pages in layout
  • Loading branch information
nyalldawson committed Aug 7, 2017
1 parent 2f49329 commit 04e6529
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/layout/qgslayoutruler.cpp
Expand Up @@ -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 ) )
Expand Down

0 comments on commit 04e6529

Please sign in to comment.