From 11cb4e22098399dfe5f732f7ab89b4f8973876be Mon Sep 17 00:00:00 2001 From: Shreyas Basarge Date: Wed, 13 Jan 2016 14:27:16 +0000 Subject: [PATCH] NPE fix in SyncStorageEngine Null check while reading malformed authorities from xml file. Bug: 26513719 Change-Id: I3bfb718bbc84b27ddd98f7941c3ca2e356d27ec0 --- .../java/com/android/server/content/SyncStorageEngine.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/content/SyncStorageEngine.java b/services/core/java/com/android/server/content/SyncStorageEngine.java index 8266c08f310f3..f8b6f5774557f 100644 --- a/services/core/java/com/android/server/content/SyncStorageEngine.java +++ b/services/core/java/com/android/server/content/SyncStorageEngine.java @@ -1903,8 +1903,10 @@ public class SyncStorageEngine extends Handler { if ("authority".equals(tagName)) { authority = parseAuthority(parser, version); periodicSync = null; - if (authority.ident > highestAuthorityId) { - highestAuthorityId = authority.ident; + if (authority != null) { + if (authority.ident > highestAuthorityId) { + highestAuthorityId = authority.ident; + } } } else if (XML_TAG_LISTEN_FOR_TICKLES.equals(tagName)) { parseListenForTickles(parser);