Skip to content

Commit

Permalink
main annotation layer should be used as a valid option even if type hint
Browse files Browse the repository at this point in the history
is set to UnknownType (fix qgis#49010)
  • Loading branch information
alexbruy committed Feb 3, 2025
1 parent 3cca51b commit 998da62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/processing/qgsprocessingutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ QgsMapLayer *QgsProcessingUtils::mapLayerFromString( const QString &string, QgsP
return nullptr;

// prefer project layers
if ( context.project() && typeHint == LayerHint::Annotation && string.compare( QLatin1String( "main" ), Qt::CaseInsensitive ) == 0 )
if ( context.project() && ( typeHint == LayerHint::Annotation || typeHint == LayerHint::UnknownType ) && string.compare( QLatin1String( "main" ), Qt::CaseInsensitive ) == 0 )
return context.project()->mainAnnotationLayer();

QgsMapLayer *layer = nullptr;
Expand Down

0 comments on commit 998da62

Please sign in to comment.