Possible crash fix: defensive checks of this.node

This commit is contained in:
Alex Gleason 2021-07-11 17:50:30 -05:00
parent 284972aa76
commit 52b14d9d09
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 3 additions and 1 deletions

View file

@ -462,7 +462,7 @@ class Status extends ImmutablePureComponent {
return; return;
} }
if (prevProps.status && ancestorsIds && ancestorsIds.size > 0) { if (prevProps.status && ancestorsIds && ancestorsIds.size > 0 && this.node) {
const element = this.node.querySelector('.detailed-status'); const element = this.node.querySelector('.detailed-status');
window.requestAnimationFrame(() => { window.requestAnimationFrame(() => {

View file

@ -463,6 +463,7 @@ class UI extends React.PureComponent {
handleHotkeyNew = e => { handleHotkeyNew = e => {
e.preventDefault(); e.preventDefault();
if (!this.node) return;
const element = this.node.querySelector('.compose-form__autosuggest-wrapper textarea'); const element = this.node.querySelector('.compose-form__autosuggest-wrapper textarea');
@ -473,6 +474,7 @@ class UI extends React.PureComponent {
handleHotkeySearch = e => { handleHotkeySearch = e => {
e.preventDefault(); e.preventDefault();
if (!this.node) return;
const element = this.node.querySelector('.search__input'); const element = this.node.querySelector('.search__input');