Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash when exporting empty report
Fixes #39086
  • Loading branch information
elpaso committed Oct 2, 2020
1 parent 7a38388 commit c45d7a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -274,7 +274,10 @@ class QgsAtlasExportGuard
mDialog->mIsExportingAtlas = false;

// need to update the GUI to reflect the final atlas feature
mDialog->atlasFeatureChanged( mDialog->currentLayout()->reportContext().feature() );
if ( mDialog->currentLayout() )
{
mDialog->atlasFeatureChanged( mDialog->currentLayout()->reportContext().feature() );
}
}

private:
Expand Down Expand Up @@ -4655,6 +4658,7 @@ void QgsLayoutDesignerDialog::toggleActions( bool layoutAvailable )
mActionExportAsPDF->setEnabled( layoutAvailable );
mActionExportAsSVG->setEnabled( layoutAvailable );
mActionPrint->setEnabled( layoutAvailable );
mActionPrintReport->setEnabled( layoutAvailable );
mActionCut->setEnabled( layoutAvailable );
mActionCopy->setEnabled( layoutAvailable );
mActionPaste->setEnabled( layoutAvailable );
Expand Down Expand Up @@ -4776,7 +4780,7 @@ void QgsLayoutDesignerDialog::setLastExportPath( const QString &path ) const
QgsSettings().setValue( QStringLiteral( "lastLayoutExportDir" ), savePath, QgsSettings::App );
}

bool QgsLayoutDesignerDialog::checkBeforeExport()
bool QgsLayoutDesignerDialog::checkBeforeExport( )
{
if ( mLayout )
{
Expand Down

0 comments on commit c45d7a4

Please sign in to comment.