diff options
author | Александр Зацепин <az@mapswithme.com> | 2019-12-23 17:25:09 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2019-12-23 18:22:37 +0300 |
commit | 38e532067881a3c00a618dfc203cdac0989c9031 (patch) | |
tree | 4f8d5a76d67bcb3a3490c6d76dd118794f4ee2cd /android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp | |
parent | 766818f2a464629501ce7b7a6800b56efa382743 (diff) |
[android] Fixed crash during access to C++ framework place page object while it's not intitialized. It may happen when the app was killed/dumped by OS when PP is opened (launched by incoming intent or deeplin) and then core doesn't have place page info and synchronization between platform and C++ framework is broken. So, we don't restore place page info from java map object and it's by design for a while.android-951
Diffstat (limited to 'android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp')
-rw-r--r-- | android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp b/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp index 45bb90e74a..cec418c841 100644 --- a/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp +++ b/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp @@ -622,6 +622,9 @@ JNIEXPORT jobject JNICALL Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAddBookmarkToLastEditedCategory( JNIEnv * env, jobject thiz, double lat, double lon) { + if (!frm()->HasPlacePageInfo()) + return nullptr; + BookmarkManager & bmMng = frm()->GetBookmarkManager(); place_page::Info const & info = g_framework->GetPlacePageInfo(); @@ -775,6 +778,9 @@ JNIEXPORT jobject JNICALL Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeUpdateBookmarkPlacePage( JNIEnv * env, jobject thiz, jlong bmkId) { + if (!frm()->HasPlacePageInfo()) + return nullptr; + auto & info = g_framework->GetPlacePageInfo(); auto buildInfo = info.GetBuildInfo(); buildInfo.m_userMarkId = static_cast<kml::MarkId>(bmkId); |