summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-03-03 17:53:51 -0800
committerSvetoslav <svetoslavganov@google.com>2014-03-03 17:59:18 -0800
commit375e23a6bcbe5a2560cd4d5fe0140f70949e0989 (patch)
treea02b16a63bca0cf786ed6d9178e012d44f4b94ff /core/java
parent1100714350923fb96d825bacd4809df2c97bea3d (diff)
NPE in AccessibilityNodeInfoCahce.
Change-Id: I2401e40842ef4ae47bba0a30a5e2589c11e488bc
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfoCache.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java b/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
index 645a9fa8ca57..b4944bee6f77 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
@@ -174,11 +174,13 @@ public class AccessibilityNodeInfoCache {
// subtrees in the cache.
// TODO: Runs in O(n^2), could optimize to O(n + n log n)
final LongArray newChildrenIds = info.getChildNodeIds();
- final int oldChildCount = oldInfo.getChildCount();
- for (int i = 0; i < oldChildCount; i++) {
- final long oldChildId = oldInfo.getChildId(i);
- if (newChildrenIds.indexOf(oldChildId) < 0) {
- clearSubTreeLocked(oldChildId);
+ if (newChildrenIds != null) {
+ final int oldChildCount = oldInfo.getChildCount();
+ for (int i = 0; i < oldChildCount; i++) {
+ final long oldChildId = oldInfo.getChildId(i);
+ if (newChildrenIds.indexOf(oldChildId) < 0) {
+ clearSubTreeLocked(oldChildId);
+ }
}
}