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

Commit cd7197dd authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Fix NPE when adding WebView to ResourcesManager

Framework resources have their mResDir set to null, since the framework
resources are implicitly always included. Guard against null
when checking to see if the Resources mResDir matches the asset path
WebView wants to inject itself into.

Bug: 36953234
Test: manual
Change-Id: Ie3dc0cc1240441a2466585224cdc7c15555c66bf
parent ba2e284a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -945,7 +945,7 @@ public class ResourcesManager {
                final ResourcesKey key = mResourceImpls.keyAt(i);
                final WeakReference<ResourcesImpl> weakImplRef = mResourceImpls.valueAt(i);
                final ResourcesImpl impl = weakImplRef != null ? weakImplRef.get() : null;
                if (impl != null && key.mResDir.equals(assetPath)) {
                if (impl != null && Objects.equals(key.mResDir, assetPath)) {
                    if (!ArrayUtils.contains(key.mLibDirs, libAsset)) {
                        final int newLibAssetCount = 1 +
                                (key.mLibDirs != null ? key.mLibDirs.length : 0);