[Android] Fix potential NPE on VLC call from 3rd party

Geoffrey Métais git at videolan.org
Fri Mar 18 10:40:52 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar 18 10:33:32 2016 +0100| [fba1998e98529426a4258a32331cedcfeb37bbcf] | committer: Geoffrey Métais

Fix potential NPE on VLC call from 3rd party

> https://code.videolan.org/videolan/vlc-android/commit/fba1998e98529426a4258a32331cedcfeb37bbcf
---

 vlc-android/src/org/videolan/vlc/StartActivity.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/StartActivity.java b/vlc-android/src/org/videolan/vlc/StartActivity.java
index 189212d..532af14 100644
--- a/vlc-android/src/org/videolan/vlc/StartActivity.java
+++ b/vlc-android/src/org/videolan/vlc/StartActivity.java
@@ -57,7 +57,7 @@ public class StartActivity extends Activity {
         super.onCreate(savedInstanceState);
         Intent intent = getIntent();
         if (intent != null && TextUtils.equals(intent.getAction(), Intent.ACTION_VIEW) && intent.getData() != null) {
-            if (intent.getType().startsWith("video")) {
+            if (intent.getType() != null && intent.getType().startsWith("video")) {
                 intent.setClass(this, VideoPlayerActivity.class);
                 startActivity(intent);
             } else {



More information about the Android mailing list