Skip to content
Permalink
Browse files
fix crash (fixes #46002)
(backports 1233c89 and 4690ed0)
  • Loading branch information
jef-n committed Nov 11, 2021
1 parent 0b98c35 commit 3d236b0b06cce51f4c622e732bbfe6d3fece50c6
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/core/layout/qgslayoututils.cpp
@@ -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

0 comments on commit 3d236b0

Please sign in to comment.