From 844b14f851ce748b7b204125264bb3343c1a9039 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 26 Jan 2011 18:18:45 -0800 Subject: [PATCH] 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 --- src/com/android/email/SecurityPolicy.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/email/SecurityPolicy.java b/src/com/android/email/SecurityPolicy.java index 9ad732f89..ef10c5992 100644 --- a/src/com/android/email/SecurityPolicy.java +++ b/src/com/android/email/SecurityPolicy.java @@ -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);