diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index e60a04024bfa..2a108aeb3111 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -391,7 +391,7 @@ QString QgsProcessingParameters::parameterAsOutputLayer( const QgsProcessingPara { dest = val.value< QgsProperty >().valueAsString( context.expressionContext(), definition->defaultValue().toString() ); } - else if ( !val.isValid() || val.toString().isEmpty() ) + else if ( definition && ( !val.isValid() || val.toString().isEmpty() ) ) { // fall back to default dest = definition->defaultValue().toString();