summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-10-30 12:59:51 +0200
committerLeif Åstrand <leif@vaadin.com>2012-10-30 13:00:20 +0200
commitd70d4c209d08cec79432e3740558a69b5b30e1d4 (patch)
tree7ec3884698a80ab171c59c3af4de0e8b2d158aa5
parent2364f3ec9fca600a5e926040ad3653de84bfed7d (diff)
downloadvaadin-framework-d70d4c209d08cec79432e3740558a69b5b30e1d4.tar.gz
vaadin-framework-d70d4c209d08cec79432e3740558a69b5b30e1d4.zip
Stop attempting to build dom path if reaching the root (#9534)
Change-Id: I5755bc292b9e752765086fcce8ce5edaa5300f34
-rw-r--r--client/src/com/vaadin/client/ComponentLocator.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ComponentLocator.java b/client/src/com/vaadin/client/ComponentLocator.java
index 47fb29777c..d24b12ffe5 100644
--- a/client/src/com/vaadin/client/ComponentLocator.java
+++ b/client/src/com/vaadin/client/ComponentLocator.java
@@ -19,6 +19,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.HasWidgets;
@@ -371,14 +372,17 @@ public class ComponentLocator {
path = PARENTCHILD_SEPARATOR + "domChild[" + childIndex + "]"
+ path;
- Element parent = e.getParentElement().cast();
+ JavaScriptObject parent = e.getParentElement();
+ if (parent == null) {
+ return null;
+ }
// The parent check is a work around for Firefox 15 which fails to
// compare elements properly (#9534)
if (parent == baseElement) {
break;
}
- e = parent;
+ e = parent.cast();
}
return path;