Skip to content

Commit

Permalink
Prevent UI crash when "Select All" is pressed from Zotero Edit menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Dec 10, 2023
1 parent e99aebf commit 3ff731d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/components/common/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function Toolbar({ onCommand }) {
let range = selection.getRangeAt(0);
let selectionRect = range.getBoundingClientRect();
let editorNode = range.startContainer.parentNode.closest('.editor');
if (!editorNode.parentNode.contains(toolbarRef.current)) {
if (!editorNode || !editorNode.parentNode.contains(toolbarRef.current)) {
toolbarRef.current.style.display = 'none';
activeRef.current = false;
return;
Expand Down

0 comments on commit 3ff731d

Please sign in to comment.