From 7000902ecbad2f68b2103ecd775d29d30da17fb8 Mon Sep 17 00:00:00 2001 From: Developer <> Date: Thu, 18 Feb 2021 17:21:02 -0500 Subject: [PATCH] Added check for if node exists before handleKeyDown on PopoverBase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - check for if node exists before handleKeyDown on PopoverBase --- app/javascript/gabsocial/components/popover/popover_base.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/javascript/gabsocial/components/popover/popover_base.js b/app/javascript/gabsocial/components/popover/popover_base.js index db08b6ec..4dc21e52 100644 --- a/app/javascript/gabsocial/components/popover/popover_base.js +++ b/app/javascript/gabsocial/components/popover/popover_base.js @@ -38,6 +38,8 @@ class PopoverBase extends ImmutablePureComponent { } handleKeyDown = (e) => { + if (!this.node) return + const items = Array.from(this.node.getElementsByTagName('a')) const index = items.indexOf(document.activeElement) let element