Browse Source

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
tags/7.6.0.beta1
pag 8 years ago
parent
commit
6539cb439f
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      client/src/com/vaadin/client/ui/VTree.java

+ 1
- 1
client/src/com/vaadin/client/ui/VTree.java View File

final int type = DOM.eventGetType(event); final int type = DOM.eventGetType(event);
final Element target = DOM.eventGetTarget(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(); iconLoaded.trigger();
} }



Loading…
Cancel
Save