[Android] Prevent NPE in PlaybackSpeedDialog
Geoffrey Métais
git at videolan.org
Thu Aug 25 14:48:51 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Aug 25 13:18:46 2016 +0200| [cc5bbad8720e0237c18d3c6b093504a3baf97eff] | committer: Geoffrey Métais
Prevent NPE in PlaybackSpeedDialog
> https://code.videolan.org/videolan/vlc-android/commit/cc5bbad8720e0237c18d3c6b093504a3baf97eff
---
.../src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java
index f0d8690..49d4662 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/PlaybackSpeedDialog.java
@@ -131,10 +131,7 @@ public class PlaybackSpeedDialog extends DialogFragment implements PlaybackServi
private View.OnClickListener mResetListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
- if (mService == null)
- return;
-
- if (mService.getRate() == 1.0d)
+ if (mService == null || mService.getRate() == 1.0d || mService.getCurrentMediaWrapper() == null)
return;
mService.setRate(1F, mService.getCurrentMediaWrapper().getType() == MediaWrapper.TYPE_AUDIO);
More information about the Android
mailing list