aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpag <gabi.antal88@gmail.com>2015-10-10 17:05:37 +0200
committerJohannes Dahlström <johannesd@vaadin.com>2015-11-04 15:10:16 +0200
commita99359895718e9d6a215f82fb24620ba9869da7c (patch)
tree58c23162f4d39dccc0f2208e04bc0c99855ac9e5
parentb8846b314349cd71bc0c1340df92a6f22bad622c (diff)
downloadvaadin-framework-a99359895718e9d6a215f82fb24620ba9869da7c.tar.gz
vaadin-framework-a99359895718e9d6a215f82fb24620ba9869da7c.zip
VTree$TreeNode avoid NPE triggered by external ONLOAD events (#18563)
If an ONLOAD event fires but the target is not the icon, an NPE occurs. The isCaptionElement method has already used the check against null before any call happens on the icon which logic is enough for the onBrowserEvent check as well. Change-Id: I64de45a07f50f113dcfcb4556f0d8adeea9e1b1b
-rw-r--r--client/src/com/vaadin/client/ui/VTree.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/VTree.java b/client/src/com/vaadin/client/ui/VTree.java
index 846b16d0cb..719b2b91b0 100644
--- a/client/src/com/vaadin/client/ui/VTree.java
+++ b/client/src/com/vaadin/client/ui/VTree.java
@@ -707,7 +707,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler,
final int type = DOM.eventGetType(event);
final Element target = DOM.eventGetTarget(event);
- if (type == Event.ONLOAD && target == icon.getElement()) {
+ if (type == Event.ONLOAD && icon != null && target == icon.getElement()) {
iconLoaded.trigger();
}