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

Commit 35d1a847 authored by Andrei Onea's avatar Andrei Onea Committed by Andrei-Valentin Onea
Browse files

Fix nullpointer exception in CompatConfig

The override config parser in CompatConfig will sometimes return a
null config (if the config is empty or malformed).

Bug: 188732264
Test: device boots
Change-Id: Ic52ad9d2e440e5551abb5e8399d97a8ca0fc42a1
parent 3d44d6ed
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -603,6 +603,10 @@ final class CompatConfig {

        try (InputStream in = new BufferedInputStream(new FileInputStream(overridesFile))) {
            Overrides overrides = com.android.server.compat.overrides.XmlParser.read(in);
            if (overrides == null) {
                Slog.w(TAG, "Parsing " + overridesFile.getPath() + " failed");
                return;
            }
            for (ChangeOverrides changeOverrides : overrides.getChangeOverrides()) {
                long changeId = changeOverrides.getChangeId();
                CompatChange compatChange = mChanges.get(changeId);