[Android] Videoplayer: prevent NPE for invalid presentation

Geoffrey Métais git at videolan.org
Thu Feb 1 14:11:39 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb  1 13:54:50 2018 +0100| [8c7930583c706beb0b0a29088c96448b8e729b6e] | committer: Geoffrey Métais

Videoplayer: prevent NPE for invalid presentation

> https://code.videolan.org/videolan/vlc-android/commit/8c7930583c706beb0b0a29088c96448b8e729b6e
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 6fe551e96..713126592 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1889,7 +1889,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         if (mDisplayManager.isPrimary()) {
             sw = getWindow().getDecorView().getWidth();
             sh = getWindow().getDecorView().getHeight();
-        } else if (mDisplayManager.getDisplayType() == DisplayManager.DisplayType.PRESENTATION) {
+        } else if (mDisplayManager.getPresentation() != null) {
             sw = mDisplayManager.getPresentation().getWindow().getDecorView().getWidth();
             sh = mDisplayManager.getPresentation().getWindow().getDecorView().getHeight();
         } else return;



More information about the Android mailing list