Fix NPE in SecurityPolicy.policiesRequired

* Add check for null Account, as this method can be called from a
  background thread, and the Account might have been deleted by the
  time we're called

Bug: 3396365
Change-Id: Ie125ed714c73d51beaedc818b6b731cea941666f
This commit is contained in:
Marc Blank 2011-01-26 18:18:45 -08:00
parent a97faa25ac
commit 844b14f851
1 changed files with 2 additions and 0 deletions

View File

@ -447,6 +447,8 @@ public class SecurityPolicy {
*/
public void policiesRequired(long accountId) {
Account account = EmailContent.Account.restoreAccountWithId(mContext, accountId);
// In case the account has been deleted, just return
if (account == null) return;
// Mark the account as "on hold".
setAccountHoldFlag(mContext, account, true);