Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix crash (fixes #46002)
(backports 1233c89 and 4690ed0)
  • Loading branch information
jef-n committed Nov 11, 2021
1 parent 0b98c35 commit 3d236b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/layout/qgslayoututils.cpp
Expand Up @@ -506,11 +506,12 @@ double QgsLayoutUtils::mmToPoints( const double mmSize )

QVector< double > QgsLayoutUtils::predefinedScales( const QgsLayout *layout )
{
QgsProject *lProject = layout ? layout->project() : nullptr;
QVector< double > mapScales;
if ( layout->project() )
mapScales = layout->project()->viewSettings()->mapScales();
if ( lProject )
mapScales = lProject->viewSettings()->mapScales();

bool hasProjectScales( layout->project()->viewSettings()->useProjectScales() );
bool hasProjectScales( lProject ? lProject->viewSettings()->useProjectScales() : false );
if ( !hasProjectScales || mapScales.isEmpty() )
{
// default to global map tool scales
Expand Down

0 comments on commit 3d236b0

Please sign in to comment.