[Android] Prevent NPE in video player

Geoffrey Métais git at videolan.org
Wed Dec 2 16:38:42 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec  2 16:30:35 2015 +0100| [55ee7513f05ffecb349263a989b5db074fbfb64a] | committer: Geoffrey Métais

Prevent NPE in video player

(cherry picked from commit 27004e0f4d1dcc045e4cadbe54c3c4bcf99c83a4)

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=55ee7513f05ffecb349263a989b5db074fbfb64a
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 5162cc4..1b98dd4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1321,7 +1321,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
      * @param duration
      */
     private void showInfo(String text, int duration) {
-        if (mPresentation == null)
+        if (mPresentation == null && mVerticalBar != null)
             mVerticalBar.setVisibility(View.GONE);
         mInfo.setVisibility(View.VISIBLE);
         mInfo.setText(text);
@@ -1330,7 +1330,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     }
 
     private void showInfo(int textid, int duration) {
-        if (mPresentation == null)
+        if (mPresentation == null && mVerticalBar != null)
             mVerticalBar.setVisibility(View.GONE);
         mInfo.setVisibility(View.VISIBLE);
         mInfo.setText(textid);
@@ -1359,7 +1359,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                     VideoPlayerActivity.this, android.R.anim.fade_out));
         mInfo.setVisibility(View.INVISIBLE);
 
-        if (mPresentation == null) {
+        if (mPresentation == null && mVerticalBar != null) {
             if (mVerticalBar.getVisibility() == View.VISIBLE) {
                 mVerticalBar.startAnimation(AnimationUtils.loadAnimation(
                         VideoPlayerActivity.this, android.R.anim.fade_out));



More information about the Android mailing list