Merge change 5386 into donut
* changes:
Fixes #1940839. Prevents NPE in RelativeLayout when a non-existing View is targeted.
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 955475e4..44cf9a4 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -1222,6 +1222,9 @@
throw new IllegalStateException("A view cannot have a dependency" +
" on itself");
}
+ if (dependency == null) {
+ continue;
+ }
// Add the current node as a dependent
dependency.dependents.add(node);
// Add a dependency to the current node