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:
parent
a97faa25ac
commit
844b14f851
|
@ -447,6 +447,8 @@ public class SecurityPolicy {
|
||||||
*/
|
*/
|
||||||
public void policiesRequired(long accountId) {
|
public void policiesRequired(long accountId) {
|
||||||
Account account = EmailContent.Account.restoreAccountWithId(mContext, 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".
|
// Mark the account as "on hold".
|
||||||
setAccountHoldFlag(mContext, account, true);
|
setAccountHoldFlag(mContext, account, true);
|
||||||
|
|
Loading…
Reference in New Issue