[Android] src: Don't crash if media is stopped

Edward Wang git at videolan.org
Fri Aug 3 18:24:55 CEST 2012


android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Fri Aug  3 12:24:54 2012 -0400| [26ef79d4c53b41a3dcb6ae21c43c237c202428f3] | committer: Edward Wang

src: Don't crash if media is stopped

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=26ef79d4c53b41a3dcb6ae21c43c237c202428f3
---

 vlc-android/src/org/videolan/vlc/AudioService.java |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index fddaa14..6d91285 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -307,6 +307,9 @@ public class AudioService extends Service {
         mMediaList.clear();
         hideNotification();
 
+        // Don't crash if user stopped the media
+        if(mCurrentMedia == null) return;
+
         // Got video, switch to the video player
         Intent intent = new Intent(VLCApplication.getAppContext(), VideoPlayerActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);



More information about the Android mailing list