Fix maybe uninitialized warning in release builds (#62741)

This commit is contained in:
Nyall Dawson 2025-08-01 13:13:52 +10:00 committed by GitHub
parent f8a09b58ea
commit 35d4c01172
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,7 +85,7 @@ QVariantMap QgsConvertGeometryTypeAlgorithm::processAlgorithm( const QVariantMap
}
const int typeIndex = parameterAsEnum( parameters, QStringLiteral( "TYPE" ), context );
Qgis::WkbType outputWkbType;
Qgis::WkbType outputWkbType = Qgis::WkbType::Unknown;
if ( typeIndex == 0 ) // centroids
{
@ -107,6 +107,10 @@ QVariantMap QgsConvertGeometryTypeAlgorithm::processAlgorithm( const QVariantMap
{
outputWkbType = Qgis::WkbType::Polygon;
}
else
{
throw QgsProcessingException( QObject::tr( "Invalid TYPE parameter value: %1" ).arg( typeIndex ) );
}
// preserve Z/M values
if ( QgsWkbTypes::hasM( source->wkbType() ) )