Skip to content

Commit a264adc

Browse files
committed
remove empty points
1 parent 4d133a5 commit a264adc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Ushahidi/Modules/V5/Http/Resources/Post/PostGeometryResource.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ public function toArray($request)
3636
}
3737
}
3838
// TODO : next code just keep the first location , later we may add a flag for primary location field
39-
foreach ($data['geojson']['features'] as $key => $feature) {
40-
if ($key > 0) {
41-
unset($data['geojson']['features'][$key]);
39+
if (isset($data['geojson'])) {
40+
foreach ($data['geojson']['features'] as $key => $feature) {
41+
if ($key > 0) {
42+
unset($data['geojson']['features'][$key]);
43+
}
4244
}
4345
}
4446
unset($data['hide_location']);

0 commit comments

Comments
 (0)