From 52b14d9d09db8d92e0a337372c27a2876af29f59 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 11 Jul 2021 17:50:30 -0500 Subject: [PATCH] Possible crash fix: defensive checks of this.node --- app/soapbox/features/status/index.js | 2 +- app/soapbox/features/ui/index.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/status/index.js b/app/soapbox/features/status/index.js index b53deca44..08135b7f9 100644 --- a/app/soapbox/features/status/index.js +++ b/app/soapbox/features/status/index.js @@ -462,7 +462,7 @@ class Status extends ImmutablePureComponent { return; } - if (prevProps.status && ancestorsIds && ancestorsIds.size > 0) { + if (prevProps.status && ancestorsIds && ancestorsIds.size > 0 && this.node) { const element = this.node.querySelector('.detailed-status'); window.requestAnimationFrame(() => { diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js index 92a9623a6..05581ac11 100644 --- a/app/soapbox/features/ui/index.js +++ b/app/soapbox/features/ui/index.js @@ -463,6 +463,7 @@ class UI extends React.PureComponent { handleHotkeyNew = e => { e.preventDefault(); + if (!this.node) return; const element = this.node.querySelector('.compose-form__autosuggest-wrapper textarea'); @@ -473,6 +474,7 @@ class UI extends React.PureComponent { handleHotkeySearch = e => { e.preventDefault(); + if (!this.node) return; const element = this.node.querySelector('.search__input');