[Android] Fix crash when action mode is null

Nicolas Pomepuy git at videolan.org
Tue May 7 12:58:12 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Tue May  7 10:57:09 2019 +0200| [51d83c09c0de35b56527896140d8dd60e7ea4295] | committer: Geoffrey Métais

Fix crash when action mode is null

> https://code.videolan.org/videolan/vlc-android/commit/51d83c09c0de35b56527896140d8dd60e7ea4295
---

 vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.kt | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.kt b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.kt
index 2f446eeb9..382675235 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.kt
@@ -279,9 +279,8 @@ abstract class MediaBrowserFragment<T : SortableModel> : Fragment(), ActionMode.
     }
 
     protected fun stopActionMode() {
-        if (actionMode != null) {
-            actionMode!!.finish()
-            onDestroyActionMode(actionMode)
+        actionMode?.let {
+            it.finish()
             setFabPlayVisibility(true)
         }
     }



More information about the Android mailing list