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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user