Fix crash when exporting empty report

Fixes #39086
This commit is contained in:
Alessandro Pasotti 2020-10-02 13:15:04 +02:00
parent 7a38388a87
commit c45d7a4a4f

View File

@ -274,7 +274,10 @@ class QgsAtlasExportGuard
mDialog->mIsExportingAtlas = false; mDialog->mIsExportingAtlas = false;
// need to update the GUI to reflect the final atlas feature // 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: private:
@ -4655,6 +4658,7 @@ void QgsLayoutDesignerDialog::toggleActions( bool layoutAvailable )
mActionExportAsPDF->setEnabled( layoutAvailable ); mActionExportAsPDF->setEnabled( layoutAvailable );
mActionExportAsSVG->setEnabled( layoutAvailable ); mActionExportAsSVG->setEnabled( layoutAvailable );
mActionPrint->setEnabled( layoutAvailable ); mActionPrint->setEnabled( layoutAvailable );
mActionPrintReport->setEnabled( layoutAvailable );
mActionCut->setEnabled( layoutAvailable ); mActionCut->setEnabled( layoutAvailable );
mActionCopy->setEnabled( layoutAvailable ); mActionCopy->setEnabled( layoutAvailable );
mActionPaste->setEnabled( layoutAvailable ); mActionPaste->setEnabled( layoutAvailable );
@ -4776,7 +4780,7 @@ void QgsLayoutDesignerDialog::setLastExportPath( const QString &path ) const
QgsSettings().setValue( QStringLiteral( "lastLayoutExportDir" ), savePath, QgsSettings::App ); QgsSettings().setValue( QStringLiteral( "lastLayoutExportDir" ), savePath, QgsSettings::App );
} }
bool QgsLayoutDesignerDialog::checkBeforeExport() bool QgsLayoutDesignerDialog::checkBeforeExport( )
{ {
if ( mLayout ) if ( mLayout )
{ {