Skip to content
Permalink
Browse files

Check if the value is null. Fixes #37781

  • Loading branch information
pblottiere committed Sep 28, 2020
1 parent 8d2a0d1 commit 86175e305fff3aeda8706c15df38411345afe054
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/server/services/wms/qgswmsrenderer.cpp
@@ -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 );
}
}

0 comments on commit 86175e3

Please sign in to comment.
You can’t perform that action at this time.