[Android] VideoPlayer: fix crash in getIntent().getData().getScheme()

Jean-Baptiste Kempf git at videolan.org
Sat Mar 9 18:43:17 CET 2013


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Mar  9 18:41:19 2013 +0100| [cef94fc51ac3bb3d4776a17a32fc5dd88d47f3a3] | committer: Jean-Baptiste Kempf

VideoPlayer: fix crash in getIntent().getData().getScheme()

This crashes a lot...

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java        |    4 +++-
 1 file changed, 3 insertions(+), 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 5f2dad7..047a2cb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1340,7 +1340,9 @@ public class VideoPlayerActivity extends Activity {
         if (getIntent().getAction() != null
                 && getIntent().getAction().equals(Intent.ACTION_VIEW)) {
             /* Started from external application */
-            if(getIntent().getData().getScheme().equals("content")) {
+            if (getIntent().getData() != null
+                    && getIntent().getData().getScheme() != null
+                    && getIntent().getData().getScheme().equals("content")) {
                 if(getIntent().getData().getHost().equals("media")) {
                     // Media URI
                     Cursor cursor = managedQuery(getIntent().getData(), new String[]{ MediaStore.Video.Media.DATA }, null, null, null);



More information about the Android mailing list