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

Commit bc7c4ed0 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Fix NPE

Reported by zezeozue@; if no package defines an application
<property> tag, getProperty() was throwing an NPE within the
package manager service.

NOTE: There's now a CTS test to ensure this works. However, it's
not sufficient. As soon as there's a single system application
that defines an application <property> tag, the test will
no longer catch the condition. We need to re-write the CTS
test as a Package Manager Service unit test and verity the
behaviour outside of the running service.

Bug: 169258655
Test: atest CtsContentTestCases:PackageManagerGetPropertyTest#testPackageRemoval
Change-Id: I117272b9b831061b9e915e0eb310d809b3afca2f
parent c8cc7844
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ public class PackageProperty {

    private Property getApplicationProperty(String propertyName, String packageName) {
        final ArrayMap<String, ArrayList<Property>> packagePropertyMap =
                mApplicationProperties.get(propertyName);
                mApplicationProperties != null ? mApplicationProperties.get(propertyName) : null;
        if (packagePropertyMap == null) {
            return null;
        }