[android] don’t crash on map changed callback when OnMapChangedListener throws a runtime exception

This commit is contained in:
Ivo van Dongen
2017-03-13 20:44:54 +02:00
committed by Ivo van Dongen
parent a0da2fb5d1
commit e3cc5ddfdd

View File

@@ -945,7 +945,11 @@ final class NativeMapView {
protected void onMapChanged(int rawChange) {
if (onMapChangedListeners != null) {
for (MapView.OnMapChangedListener onMapChangedListener : onMapChangedListeners) {
onMapChangedListener.onMapChanged(rawChange);
try {
onMapChangedListener.onMapChanged(rawChange);
} catch (RuntimeException err) {
Timber.e("Exception (%s) in MapView.OnMapChangedListener: %s", err.getClass(), err.getMessage());
}
}
}
}