From f44b9440d83a49061105ee854e29009afb5c9e77 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 22 Apr 2010 17:43:30 -0700 Subject: [PATCH] Add checks for null in SyncManager Bug: 2619723 Change-Id: Iea3c3258274bdf86784e232922290841ad0d9d36 --- src/com/android/exchange/SyncManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/exchange/SyncManager.java b/src/com/android/exchange/SyncManager.java index 5eb7b2d82..4ee48c617 100644 --- a/src/com/android/exchange/SyncManager.java +++ b/src/com/android/exchange/SyncManager.java @@ -534,6 +534,7 @@ public class SyncManager extends Service implements Runnable { // An account has changed Account updatedAccount = Account.restoreAccountWithId(context, account.mId); + if (updatedAccount == null) continue; if (account.mSyncInterval != updatedAccount.mSyncInterval || account.mSyncLookback != updatedAccount.mSyncLookback) { // Set pushable boxes' interval to the interval of the Account @@ -563,13 +564,14 @@ public class SyncManager extends Service implements Runnable { // Look for new accounts for (Account account : currentAccounts) { if (!sAccountList.contains(account.mId)) { - // This is an addition; create our magic hidden mailbox... - log("Account observer found new account: " + account.mDisplayName); - addAccountMailbox(account.mId); // Don't forget to cache the HostAuth HostAuth ha = HostAuth.restoreHostAuthWithId(getContext(), account.mHostAuthKeyRecv); + if (ha == null) continue; account.mHostAuthRecv = ha; + // This is an addition; create our magic hidden mailbox... + log("Account observer found new account: " + account.mDisplayName); + addAccountMailbox(account.mId); sAccountList.add(account); mSyncableEasMailboxSelector = null; mEasAccountSelector = null;