Esri / arcgis-maps-sdk-dotnet-toolkit

Toolkit for ArcGIS Maps SDK for .NET
https://esri.github.io/arcgis-maps-sdk-dotnet-toolkit/
Apache License 2.0
211 stars 121 forks source link

Prevent unhandled exception when FieldsPopupElement.Fields list is empty #520

Closed AndrewBladon closed 1 year ago

AndrewBladon commented 1 year ago

Issue: none

Description: When using a popup view with a feature layer that does not have any attributes (e.g. point has no default attributes), a System.ArgumentException can occur in the FieldPopupElementView.RefreshTable() method (see image below for exception details). This PR introduces a check to see if the FieldsPopupElement.Fields list is empty and, if the list is empty, results in the content being set to null and the method returning. This prevents the exception occuring.

image

Summary of issue: In the FieldPopupElementView.RefreshTable() method:

williambohrmann3 commented 1 year ago

cc @dotMorten