[Android] Avoid a crash on null getData() intent

Jean-Baptiste Kempf git at videolan.org
Wed Apr 2 20:08:48 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Apr  2 20:02:39 2014 +0200| [0cf45f0d237a2589a6f6ccd952f7a2a9f15b25dd] | committer: Jean-Baptiste Kempf

Avoid a crash on null getData() intent

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

 .../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 4380a94..064deaf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1759,7 +1759,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
                     // other content-based URI (probably file pickers)
                     mLocation = getIntent().getData().getPath();
                 }
-            } else {
+            } else if (getIntent().getDataString() != null) {
                 // Plain URI
                 mLocation = getIntent().getDataString();
                 // Remove VLC prefix if needed
@@ -1774,6 +1774,8 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
                         e.printStackTrace();
                     }
                 }
+            } else {
+                Log.e(TAG, "Couldn't undertstand the intents");
             }
             if(getIntent().getExtras() != null)
                 intentPosition = getIntent().getExtras().getLong("position", -1);



More information about the Android mailing list