Remove null entries from constant state cache
We insert null entries on cache miss, which can cause NPE on prune, but we ought to remove these entries during prune. BUG: 18842826 Change-Id: I9c0bca04f34575d1403de943abd8d12b18c9c032
This commit is contained in:
@@ -2463,7 +2463,7 @@ public class Resources {
|
||||
final int N = cache.size();
|
||||
for (int i = N - 1; i >= 0; i--) {
|
||||
final WeakReference entry = cache.valueAt(i);
|
||||
if (entry.get() == null) {
|
||||
if (entry == null || entry.get() == null) {
|
||||
cache.removeAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user