Browse Source

fix possible NPE on stopping contact backup job (#4387)

fix possible NPE on stopping contact backup job
Tobias Kaminsky 5 years ago
parent
commit
331edcb69c

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/ContactsPreferenceActivity.java

@@ -126,7 +126,7 @@ public class ContactsPreferenceActivity extends FileActivity implements FileFrag
 
         for (JobRequest jobRequest : jobs) {
             PersistableBundleCompat extras = jobRequest.getExtras();
-            if (extras.getString(ContactsBackupJob.ACCOUNT, "").equalsIgnoreCase(account.name) &&
+            if (extras != null && extras.getString(ContactsBackupJob.ACCOUNT, "").equalsIgnoreCase(account.name) &&
                     jobRequest.isPeriodic()) {
                 jobManager.cancel(jobRequest.getJobId());
             }