aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-11-19 17:43:40 +0100
committerThomas White <taw@physics.org>2017-11-19 17:43:40 +0100
commit81b068ebc0841b9716543da99627092396ffa613 (patch)
treeedf59f9c70fb3272eadbea46280cffc98b6f41ce
parent39748a25d9e3d6f43e76ff9268acf15c7c5a37c6 (diff)
Don't try to split in a NULL frame
-rw-r--r--src/sc_editor.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index cd1e8ba..3139294 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -634,6 +634,8 @@ SCBlock *split_paragraph_at_cursor(SCEditor *e)
size_t offs;
Paragraph *para;
+ if ( e->cursor_frame == NULL ) return NULL;
+
para = e->cursor_frame->paras[e->cursor_para];
offs = pos_trail_to_offset(para, e->cursor_pos, e->cursor_trail);
return split_paragraph(e->cursor_frame, e->cursor_para, offs, e->pc);