From 8100a2dc5510d0449921895e2af8472d3666fda3 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 13 May 2010 13:33:37 -0700 Subject: [PATCH] Server sending unsupported policies will cause NPE * Add null check after trying to create a PolicySet during provisioning. Bug: 2683220 Change-Id: If20adbd4287b291e6470591fd2c3ac1f69ad2355 --- src/com/android/exchange/EasSyncService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index c62971c81..a01bdc290 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -1286,7 +1286,10 @@ public class EasSyncService extends AbstractSyncService { // the framework; if so, return the ProvisionParser containing the policy set and // temporary key PolicySet ps = pp.getPolicySet(); - if (SecurityPolicy.getInstance(mContext).isSupported(ps)) { + // The PolicySet can be null if there are policies we don't know about (e.g. ones + // from Exchange 12.1) If we have a PolicySet, then we ask whether the device can + // support the actual parameters of those policies. + if ((ps != null) && SecurityPolicy.getInstance(mContext).isSupported(ps)) { return pp; } }