From 6704956b229393a55b086811de664393ef983e76 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 2 Dec 2017 21:41:28 +0300 Subject: [PATCH] fixup 0de69e30: avoid passing falsy selectors to $() --- js/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/dom.js b/js/dom.js index 3dfaa164..969dc5c0 100644 --- a/js/dom.js +++ b/js/dom.js @@ -12,7 +12,7 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection]) } $.remove = (selector, base = document) => { - const el = selector instanceof Node ? selector : $(selector, base); + const el = selector && typeof selector === 'string' ? $(selector, base) : selector; if (el) { el.remove(); }