Skip to content

Commit

Permalink
fix sample crash
Browse files Browse the repository at this point in the history
  • Loading branch information
duffh committed Aug 11, 2023
1 parent 6e93c71 commit a8363f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private async Task LoadLocalGeodatabaseTables()

// Create a new feature layer to show the table in the map.
FeatureLayer layer = new FeatureLayer(table);
Dispatcher.Invoke(() => MyMapView.Map.OperationalLayers.Add(layer));
Dispatcher.Invoke(() => MyMapView.Map?.OperationalLayers.Add(layer));
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private async Task LoadLocalGeodatabaseTables()

// Create a new feature layer to show the table in the map.
FeatureLayer layer = new FeatureLayer(table);
DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () => MyMapView.Map.OperationalLayers.Add(layer));
DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () => MyMapView.Map?.OperationalLayers.Add(layer));
}
catch (Exception e)
{
Expand Down

0 comments on commit a8363f7

Please sign in to comment.