Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Koenig - Fix error on backspace with heading as first section
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinansfield committed May 9, 2018
1 parent e2a6edb commit 7772cfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/koenig-editor/addon/components/koenig-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ export default Component.extend({

// if cursor is at the beginning of a heading and previous section is a
// blank paragraph, delete the blank paragraph
if (isCollapsed && offset === 0 && section.tagName.match(/^h\d$/) && section.prev.tagName === 'p' && section.prev.isBlank) {
if (isCollapsed && offset === 0 && section.tagName.match(/^h\d$/) && section.prev && section.prev.tagName === 'p' && section.prev.isBlank) {
editor.run((postEditor) => {
postEditor.removeSection(section.prev);
});
Expand Down

0 comments on commit 7772cfe

Please sign in to comment.