Skip to content

Commit 0e2ae5b

Browse files
fix: Extended safeches to prevent IOS | Android crashes
1 parent fe2e5af commit 0e2ae5b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/map-view.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,15 @@ export class MapView extends MapViewBase {
381381
}
382382

383383
addMarker(...markers: Marker[]) {
384-
if(!markers || !this.gMap) return null;
384+
if(!markers || !this._markers || !this.gMap) return null;
385385
markers.forEach(marker => {
386386
marker.android = this.gMap.addMarker(marker.android);
387387
this._markers.push(marker);
388388
});
389389
}
390390

391391
removeMarker(...markers: Marker[]) {
392-
if(!markers || !this.gMap) return null;
392+
if(!markers || !this._markers || !this.gMap) return null;
393393
markers.forEach(marker => {
394394
this._unloadInfoWindowContent(marker);
395395
marker.android.remove();

src/map-view.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,15 @@ export class MapView extends MapViewBase {
313313
}
314314

315315
addMarker(...markers: Marker[]) {
316-
if(!markers || !this.gMap) return null;
316+
if(!markers || !this._markers || !this.gMap) return null;
317317
markers.forEach(marker => {
318318
marker.ios.map = this.gMap;
319319
this._markers.push(marker);
320320
});
321321
}
322322

323323
removeMarker(...markers: Marker[]) {
324-
if(!markers || !this.gMap) return null;
324+
if(!markers || !this._markers || !this.gMap) return null;
325325
markers.forEach(marker => {
326326
this._unloadInfoWindowContent(marker);
327327
marker.ios.map = null;

0 commit comments

Comments
 (0)