From 29fcb98205d44770e5533329ad37d336197aba59 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 24 Jul 2017 13:08:07 +0300 Subject: [PATCH 1/2] Add check as in closeRecordingMenu() --- .../plus/audionotes/AudioVideoNotesPlugin.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 7103e2457a..ed8850d105 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -862,14 +862,16 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { } private void initRecMenu(AVActionType actionType, double lat, double lon) { - currentRecording = new CurrentRecording(actionType); - if (actionType == AVActionType.REC_PHOTO) { - recordingMenu = new AudioVideoNoteRecordingMenuFullScreen(this, lat, lon); - } else { - recordingMenu = new AudioVideoNoteRecordingMenu(this, lat, lon); + if (mapActivity != null) { + currentRecording = new CurrentRecording(actionType); + if (actionType == AVActionType.REC_PHOTO) { + recordingMenu = new AudioVideoNoteRecordingMenuFullScreen(this, lat, lon); + } else { + recordingMenu = new AudioVideoNoteRecordingMenu(this, lat, lon); + } + recordingDone = false; + lockScreenOrientation(); } - recordingDone = false; - lockScreenOrientation(); } public void recordVideo(final double lat, final double lon, final MapActivity mapActivity) { From 88275532f24342ec80a61392f0c61495c11bf10b Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 24 Jul 2017 14:17:04 +0300 Subject: [PATCH 2/2] Fix NPE --- .../net/osmand/plus/liveupdates/LiveUpdatesFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index 1fc232bd47..95f5fef2e1 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -240,8 +240,10 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList } public void notifyLiveUpdatesChanged() { - if (adapter != null && getMyApplication() != null && getActivity() != null) { - adapter.notifyLiveUpdatesChanged(); + if (getActivity() != null) { + if (adapter != null && getMyApplication() != null) { + adapter.notifyLiveUpdatesChanged(); + } } }