[Android] Fix NullPointerException
Nicolas Pomepuy
git at videolan.org
Wed Aug 5 14:29:59 CEST 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Aug 5 07:53:28 2020 +0200| [f04ea07fcce258d93cc3b789882a216fa57e6548] | committer: Nicolas Pomepuy
Fix NullPointerException
> https://code.videolan.org/videolan/vlc-android/commit/f04ea07fcce258d93cc3b789882a216fa57e6548
---
.../src/org/videolan/vlc/gui/browser/FilePickerFragment.kt | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt
index cb1b4a933..8a8149ae0 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt
@@ -57,10 +57,11 @@ class FilePickerFragment : FileBrowserFragment(), BrowserContainer<MediaLibraryI
}
override fun onCreate(bundle: Bundle?) {
- val media = requireActivity().intent.getParcelableExtra<MediaWrapper>(KEY_MEDIA)
- if (media.uri == null ||media. uri.scheme == "http" || media.uri.scheme == "content" || media.uri.scheme == "fd") {
- activity?.intent = null
- }
+ requireActivity().intent?.getParcelableExtra<MediaWrapper>(KEY_MEDIA)?.let {media ->
+ if (media.uri == null || media.uri.scheme == "http" || media.uri.scheme == "content" || media.uri.scheme == "fd") {
+ activity?.intent = null
+ }
+ }
super.onCreate(bundle)
adapter = FilePickerAdapter(this)
}
More information about the Android
mailing list