Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a962d9eb authored by Shreyas Basarge's avatar Shreyas Basarge
Browse files

NPE fix for SyncStorageEngine read authority

Add a null check after an authority is read
from disk.

Bug: 26513719
Change-Id: I18f01828141110e776cc96f3b3be3d80125e70c1
parent a5cafd2a
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
import android.util.Xml;
import android.util.EventLog;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
@@ -1746,9 +1747,14 @@ public class SyncStorageEngine extends Handler {
                            if ("authority".equals(tagName)) {
                                authority = parseAuthority(parser, version);
                                periodicSync = null;
                                if (authority != null) {
                                    if (authority.ident > highestAuthorityId) {
                                        highestAuthorityId = authority.ident;
                                    }
                                } else {
                                    EventLog.writeEvent(0x534e4554, "26513719", -1,
                                            "Malformed authority");
                                }
                            } else if (XML_TAG_LISTEN_FOR_TICKLES.equals(tagName)) {
                                parseListenForTickles(parser);
                            }