浏览代码

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

fix possible NPE on stopping contact backup job
Tobias Kaminsky 5 年之前
父节点
当前提交
331edcb69c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/main/java/com/owncloud/android/ui/activity/ContactsPreferenceActivity.java

+ 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());
             }