diff --git a/app/src/main/java/foundation/e/drive/services/InitializerService.java b/app/src/main/java/foundation/e/drive/services/InitializerService.java index 7492739990b54bd593eceb2747fd8acb6b3b70ec..cafe34ffb39fabb601a3ae17a1999c0a2bfb7fc9 100644 --- a/app/src/main/java/foundation/e/drive/services/InitializerService.java +++ b/app/src/main/java/foundation/e/drive/services/InitializerService.java @@ -47,7 +47,7 @@ public class InitializerService extends Service { } @Override - public int onStartCommand(@NonNull Intent intent, int flags, int startId) { + public int onStartCommand(@Nullable Intent intent, int flags, int startId) { Timber.i("onStartCommand()"); DavClientProvider.getInstance().cleanUp(); CommonUtils.setServiceUnCaughtExceptionHandler(this); @@ -58,7 +58,7 @@ public class InitializerService extends Service { String accountName = prefs.getString(AccountManager.KEY_ACCOUNT_NAME, ""); String accountType = prefs.getString(AccountManager.KEY_ACCOUNT_TYPE, ""); - if (accountName.isEmpty() && accountType.isEmpty() && intent.getExtras() != null) { + if (accountName.isEmpty() && accountType.isEmpty() && intent != null && intent.getExtras() != null) { accountName = intent.getExtras().getString(AccountManager.KEY_ACCOUNT_NAME, ""); accountType = intent.getExtras().getString(AccountManager.KEY_ACCOUNT_TYPE, "");