Skip to content

Commit

Permalink
Fallback to feature id if pk attribute is not there
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Mar 4, 2018
1 parent 45f04b7 commit b0d3548
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/server/qgsowsserver.cpp
Expand Up @@ -85,7 +85,13 @@ QString QgsOWSServer::featureGmlId( const QgsFeature* f, const QgsAttributeList&
{
pkId.append( pkSeparator() );
}
pkId.append( f->attribute( *it ).toString() );

QVariant pkAttribute = f->attribute( *it );
if ( !pkAttribute.isValid() )
{
return QString::number( f->id() );
}
pkId.append( pkAttribute.toString() );
}
return pkId;
}

0 comments on commit b0d3548

Please sign in to comment.