瀏覽代碼

Merge pull request #1019 from nextcloud/npeInContactBackups

NPE in contact backups
Mario Đanić 8 年之前
父節點
當前提交
a5329a6aa7
共有 1 個文件被更改,包括 7 次插入5 次删除
  1. 7 5
      src/main/java/com/owncloud/android/services/ContactsBackupJob.java

+ 7 - 5
src/main/java/com/owncloud/android/services/ContactsBackupJob.java

@@ -1,20 +1,20 @@
-/**
+/*
  * Nextcloud Android client application
  * Nextcloud Android client application
  *
  *
  * @author Tobias Kaminsky
  * @author Tobias Kaminsky
  * Copyright (C) 2017 Tobias Kaminsky
  * Copyright (C) 2017 Tobias Kaminsky
  * Copyright (C) 2017 Nextcloud GmbH.
  * Copyright (C) 2017 Nextcloud GmbH.
- * <p>
+ *
  * This program is free software: you can redistribute it and/or modify
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
  * it under the terms of the GNU Affero General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * the Free Software Foundation, either version 3 of the License, or
  * at your option) any later version.
  * at your option) any later version.
- * <p>
+ *
  * This program is distributed in the hope that it will be useful,
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Affero General Public License for more details.
  * GNU Affero General Public License for more details.
- * <p>
+ *
  * You should have received a copy of the GNU Affero General Public License
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
  */
@@ -173,7 +173,9 @@ public class ContactsBackupJob extends Job {
             cal.add(Calendar.DAY_OF_YEAR, -daysToExpire);
             cal.add(Calendar.DAY_OF_YEAR, -daysToExpire);
             Long timestampToExpire = cal.getTimeInMillis();
             Long timestampToExpire = cal.getTimeInMillis();
 
 
-            Log_OC.d(TAG, "expire: " + daysToExpire + " " + backupFolder.getFileName());
+            if (backupFolder != null) {
+                Log_OC.d(TAG, "expire: " + daysToExpire + " " + backupFolder.getFileName());
+            }
 
 
             Vector<OCFile> backups = storageManager.getFolderContent(backupFolder, false);
             Vector<OCFile> backups = storageManager.getFolderContent(backupFolder, false);