diff options
author | michaelvogt <michael@vaadin.com> | 2013-03-06 14:11:59 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-03-06 12:29:54 +0000 |
commit | a4c5cc660ffdec582d227715245d90191e46dd09 (patch) | |
tree | 3509a65e2e7a7b30b6924dc67aca4a45076cc280 /client | |
parent | 4c7b338a925c79ba0053fab11b730d931bbf665a (diff) | |
download | vaadin-framework-a4c5cc660ffdec582d227715245d90191e46dd09.tar.gz vaadin-framework-a4c5cc660ffdec582d227715245d90191e46dd09.zip |
#11265 AriaHandler NPE
Fixes JavaScript exception when debug window is open
Change-Id: Ic296cc643cf7b128c34d6446a05ea89a85bdcc35
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/AriaHelper.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/client/src/com/vaadin/client/ui/AriaHelper.java b/client/src/com/vaadin/client/ui/AriaHelper.java index e762ba57ce..f7b35add1d 100644 --- a/client/src/com/vaadin/client/ui/AriaHelper.java +++ b/client/src/com/vaadin/client/ui/AriaHelper.java @@ -24,16 +24,18 @@ public class AriaHelper { public static void bindCaption(Widget widget, Element captionElement) { assert widget != null : "Valid Widget required"; - ensureUniqueId(captionElement); + if (null != captionElement) { + ensureUniqueId(captionElement); - if (widget instanceof HandlesAriaCaption) { - ((HandlesAriaCaption) widget).handleAriaCaption(captionElement); - } else if (captionElement != null) { - String ownerId = ensureUniqueId(widget.getElement()); - captionElement.setAttribute("for", ownerId); + if (widget instanceof HandlesAriaCaption) { + ((HandlesAriaCaption) widget).handleAriaCaption(captionElement); + } else { + String ownerId = ensureUniqueId(widget.getElement()); + captionElement.setAttribute("for", ownerId); - Roles.getTextboxRole().setAriaLabelledbyProperty( - widget.getElement(), Id.of(captionElement)); + Roles.getTextboxRole().setAriaLabelledbyProperty( + widget.getElement(), Id.of(captionElement)); + } } else { Roles.getTextboxRole().removeAriaLabelledbyProperty( widget.getElement()); |