From 175b4a0a6b099ced070c9b11127d22f9e3e6b273 Mon Sep 17 00:00:00 2001 From: demasterr Date: Sat, 9 Mar 2019 17:42:36 +0100 Subject: [PATCH] Fixed possible NullPointException mSearchController nSearchController.hide() could throw a NullPointerException. Furthermore, the check later would then be redundant and should be moved earlier. --- android/src/com/mapswithme/maps/MwmActivity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 6850be27ef..fb65c72da8 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -1264,13 +1264,12 @@ public class MwmActivity extends BaseMwmFragmentActivity return; } - if (mSearchController.hide()) + if (mSearchController != null && mSearchController.hide()) { SearchEngine.INSTANCE.cancelInteractiveSearch(); if (mFilterController != null) mFilterController.resetFilter(); - if (mSearchController != null) - mSearchController.clear(); + mSearchController.clear(); return; }