Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14898 from mapbox/tvn-allow-null-updates
Browse files Browse the repository at this point in the history
Allow null updates to GeoJsonSource#setGeoJson
  • Loading branch information
tobrun committed Jun 11, 2019
1 parent 314032d commit e3d87ed
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.UiThread;

import com.mapbox.geojson.Feature;
import com.mapbox.geojson.FeatureCollection;
import com.mapbox.geojson.Geometry;
Expand Down Expand Up @@ -287,14 +286,14 @@ public void setGeoJson(Geometry geometry) {
*
* @param featureCollection the GeoJSON FeatureCollection
*/
public void setGeoJson(FeatureCollection featureCollection) {
public void setGeoJson(@Nullable FeatureCollection featureCollection) {
if (detached) {
return;
}
checkThread();

List<Feature> features = featureCollection.features();
if (features != null) {
if (featureCollection != null && featureCollection.features() != null) {
List<Feature> features = featureCollection.features();
List<Feature> featuresCopy = new ArrayList<>(features);
nativeSetFeatureCollection(FeatureCollection.fromFeatures(featuresCopy));
} else {
Expand Down

0 comments on commit e3d87ed

Please sign in to comment.