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

Allow null updates to GeoJsonSource#setGeoJson #14898

Merged
merged 1 commit into from
Jun 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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