mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Check if the value is null. Fixes #37781
This commit is contained in:
parent
8d2a0d1ebb
commit
86175e305f
@ -1774,7 +1774,14 @@ namespace QgsWms
|
||||
{
|
||||
QDomElement attributeElement = infoDocument.createElement( QStringLiteral( "Attribute" ) );
|
||||
attributeElement.setAttribute( QStringLiteral( "name" ), layer->bandName( it.key() ) );
|
||||
attributeElement.setAttribute( QStringLiteral( "value" ), QString::number( it.value().toDouble() ) );
|
||||
|
||||
QString value( QStringLiteral( "no data" ) );
|
||||
if ( ! it.value().isNull() )
|
||||
{
|
||||
value = QString::number( it.value().toDouble() );
|
||||
}
|
||||
|
||||
attributeElement.setAttribute( QStringLiteral( "value" ), value );
|
||||
layerElement.appendChild( attributeElement );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user