[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Thu Aug 3 15:44:53 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Aug  3 13:37:23 2017 +0200| [6adf1294ad3f803d6d90a28410bc97385496255a] | committer: Geoffrey Métais

Prevent NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.java b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
index 12a289ef2..446526d25 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.java
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
@@ -118,6 +118,8 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
 
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
+        if (intent == null)
+            return START_NOT_STICKY;
         synchronized (MediaParsingService.this) {
             if (mLastNotificationTime <= 0L)
                 mLastNotificationTime = System.currentTimeMillis();



More information about the Android mailing list