Parcourir la source

Merge pull request #1993 from nextcloud/intentNPE

Intent can be null if service is restarted
Andy Scherzinger il y a 7 ans
Parent
commit
60c416ea26

+ 5 - 0
src/main/java/com/owncloud/android/files/services/FileUploader.java

@@ -499,6 +499,11 @@ public class FileUploader extends Service
         Log_OC.d(TAG, "Starting command with id " + startId);
 
         startForeground(FOREGROUND_SERVICE_ID, mNotification);
+        
+        if (intent == null) {
+            Log_OC.e(TAG, "Intent is null");
+            return Service.START_NOT_STICKY;
+        }
 
         boolean retry = intent.getBooleanExtra(KEY_RETRY, false);
         AbstractList<String> requestedUploads = new Vector<String>();