0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Check for null return from Range#getStartBlock.

This commit is contained in:
Neil Jenkins 2013-04-05 15:58:34 +11:00
parent 02d25f0ef5
commit 10abc3faf8

View file

@ -1658,7 +1658,7 @@
getRangeAndRemoveBookmark( range );
event.preventDefault();
var current = range.getStartBlock(),
previous = current.getPreviousBlock();
previous = current && current.getPreviousBlock();
// Must not be at the very beginning of the text area.
if ( previous ) {
// If not editable, just delete whole block.
@ -1723,7 +1723,7 @@
getRangeAndRemoveBookmark( range );
event.preventDefault();
var current = range.getStartBlock(),
next = current.getNextBlock();
next = current && current.getNextBlock();
// Must not be at the very end of the text area.
if ( next ) {
// If not editable, just delete whole block.