[android] - wrap jni callback with try-catch

This commit is contained in:
tobrun
2019-05-17 17:30:01 +02:00
committed by Tobrun
parent 99f090b955
commit 52a69044e8

View File

@@ -1055,15 +1055,21 @@ final class NativeMapView implements NativeMap {
if (checkState("OnSnapshotReady")) {
return;
}
if (snapshotReadyCallback != null && mapContent != null) {
if (viewCallback == null) {
snapshotReadyCallback.onSnapshotReady(mapContent);
} else {
Bitmap viewContent = viewCallback.getViewContent();
if (viewContent != null) {
snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent));
try {
if (snapshotReadyCallback != null && mapContent != null) {
if (viewCallback == null) {
snapshotReadyCallback.onSnapshotReady(mapContent);
} else {
Bitmap viewContent = viewCallback.getViewContent();
if (viewContent != null) {
snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent));
}
}
}
} catch (Throwable err) {
Logger.e(TAG, "Exception in onSnapshotReady", err);
throw err;
}
}