[Android] Prevent NPE in video playlist
Geoffrey Métais
git at videolan.org
Thu Feb 2 16:26:46 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 2 15:45:08 2017 +0100| [0b7c3ebbdc4c859c933de0a23775dca9747eb07b] | committer: Geoffrey Métais
Prevent NPE in video playlist
> https://code.videolan.org/videolan/vlc-android/commit/0b7c3ebbdc4c859c933de0a23775dca9747eb07b
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 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 ebd4319..d3b8233 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2883,12 +2883,14 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
}
// Update all view elements
- mSeekbar.setMax(length);
- mSeekbar.setProgress(time);
+ if (mSeekbar != null) {
+ mSeekbar.setMax(length);
+ mSeekbar.setProgress(time);
+ }
if (mSysTime != null)
mSysTime.setText(DateFormat.getTimeFormat(this).format(new Date(System.currentTimeMillis())));
- if (time >= 0) mTime.setText(Tools.millisToString(time));
- if (length >= 0) mLength.setText(mDisplayRemainingTime && length > 0
+ if (mTime != null && time >= 0) mTime.setText(Tools.millisToString(time));
+ if (mLength != null && length >= 0) mLength.setText(mDisplayRemainingTime && length > 0
? "-" + '\u00A0' + Tools.millisToString(length - time)
: Tools.millisToString(length));
More information about the Android
mailing list