Skip to content

Commit

Permalink
fix crash when using a script with a QgsProcessingParameterDateTime i…
Browse files Browse the repository at this point in the history
…n the modeler (#35080)
  • Loading branch information
3nids committed Mar 14, 2020
1 parent b134c77 commit 77fcfe9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
Expand Up @@ -3859,16 +3859,19 @@ QList<int> QgsProcessingDateTimeWidgetWrapper::compatibleDataTypes() const
QString QgsProcessingDateTimeWidgetWrapper::modelerExpressionFormatString() const
{
const QgsProcessingParameterDateTime *dateTimeParam = dynamic_cast< const QgsProcessingParameterDateTime *>( parameterDefinition() );
switch ( dateTimeParam->dataType() )
if ( dateTimeParam )
{
case QgsProcessingParameterDateTime::DateTime:
return tr( "datetime value, or a ISO string representation of a datetime" );
switch ( dateTimeParam->dataType() )
{
case QgsProcessingParameterDateTime::DateTime:
return tr( "datetime value, or a ISO string representation of a datetime" );

case QgsProcessingParameterDateTime::Date:
return tr( "date value, or a ISO string representation of a date" );
case QgsProcessingParameterDateTime::Date:
return tr( "date value, or a ISO string representation of a date" );

case QgsProcessingParameterDateTime::Time:
return tr( "time value, or a ISO string representation of a time" );
case QgsProcessingParameterDateTime::Time:
return tr( "time value, or a ISO string representation of a time" );
}
}
return QString();
}
Expand Down

0 comments on commit 77fcfe9

Please sign in to comment.