Skip to content

Commit

Permalink
Merge pull request #1359 from nojacko/dev
Browse files Browse the repository at this point in the history
Prevent error when there's no activeElement during undo/redo
  • Loading branch information
artf authored Aug 13, 2018
2 parents 81ecb2b + 8c72cd5 commit 1cac4b1
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 1cac4b1

Please sign in to comment.