From f02a044bd8166fa99f5a309e02eba7a2d73bda02 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Wed, 1 Mar 2017 13:53:07 +1100 Subject: [PATCH] fix(core/ui): return early if element is not passed --- js/core/ui.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/core/ui.js b/js/core/ui.js index 1f3993b801..b797096dfd 100644 --- a/js/core/ui.js +++ b/js/core/ui.js @@ -17,6 +17,10 @@ define([ function(shortcut, pubsubhub) { function ariaDecorate(elem, ariaMap) { + if (!elem) { + debugger; + return; + } Array .from(ariaMap.entries()) .reduce(function(elem, nameValue) { @@ -39,8 +43,8 @@ define([ "
", document) .appendTo($("body", document)); - const $respecPill = $("") - .click(function(e) { + const $respecPill = $(""); + $respecPill.click(function(e) { e.stopPropagation(); const expand = this.getAttribute("aria-expanded") === "true" ? "false" : "true"; this.setAttribute("aria-expanded", expand);