Skip to content

Commit

Permalink
Prevent error when there's no activeElement during undo/redo
Browse files Browse the repository at this point in the history
  • Loading branch information
James Jackson committed Aug 13, 2018
1 parent 81ecb2b commit 8c72cd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/canvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ module.exports = () => {
* @return {Boolean}
*/
isInputFocused() {
return this.getFrameEl().contentDocument.activeElement.tagName !== 'BODY';
let contentDocument = this.getFrameEl().contentDocument;
return (
contentDocument.activeElement &&
contentDocument.activeElement.tagName !== 'BODY'
);
},

/**
Expand Down

0 comments on commit 8c72cd5

Please sign in to comment.