Skip to content

Commit

Permalink
fix: blocks.delete with undefined index (codex-team#1182)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenrichard committed Jul 3, 2020
1 parent 4cea66f commit b2964d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/modules/api/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export default class BlocksAPI extends Module {
/**
* After Block deletion currentBlock is updated
*/
this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock, this.Editor.Caret.positions.END);
if (this.Editor.BlockManager.currentBlock) {
this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock, this.Editor.Caret.positions.END);
}

this.Editor.Toolbar.close();
}
Expand Down

0 comments on commit b2964d8

Please sign in to comment.