[Android] Info view: Rename variable and nullity check

Geoffrey Métais git at videolan.org
Thu Jul 13 11:04:12 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jul 13 11:02:43 2017 +0200| [823a8a705f039106c31daecf0fee801a77ae9bba] | committer: Geoffrey Métais

Info view: Rename variable and nullity check

> https://code.videolan.org/videolan/vlc-android/commit/823a8a705f039106c31daecf0fee801a77ae9bba
---

 vlc-android/src/org/videolan/vlc/gui/InfoActivity.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java b/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java
index c944364c9..7c78741b0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/InfoActivity.java
@@ -68,10 +68,14 @@ public class InfoActivity extends AudioPlayerContainerActivity implements View.O
         mItem = (MediaLibraryItem) (savedInstanceState != null ?
                 savedInstanceState.getParcelable(TAG_ITEM) :
                 getIntent().getParcelableExtra(TAG_ITEM));
+        if (mItem == null) {
+            finish();
+            return;
+        }
         if (mItem.getId() == 0L) {
-            MediaLibraryItem mediaWrapper = VLCApplication.getMLInstance().getMedia(((MediaWrapper)mItem).getUri());
-            if (mediaWrapper != null)
-                mItem = mediaWrapper;
+            MediaLibraryItem libraryItem = VLCApplication.getMLInstance().getMedia(((MediaWrapper)mItem).getUri());
+            if (libraryItem != null)
+                mItem = libraryItem;
         }
         mBinding.setItem(mItem);
         final int fabVisibility =  savedInstanceState != null



More information about the Android mailing list