aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-09-21 15:28:06 +0200
committerThomas White <taw@bitwiz.org.uk>2016-09-21 15:28:06 +0200
commit56b1ef0971f4b4bc3a732b632fee5cee00009631 (patch)
tree23cbac3f8566514795d0b964efb7bb78b60c5128
parentfed1bb69cd8aca704b5f0aa36dc2a90ff1e8c53a (diff)
Fix segfault
-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 5aeb003..fd558be 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -608,6 +608,8 @@ static void check_cursor_visible(SCEditor *e)
size_t offs;
Paragraph *para;
+ if ( e->cursor_frame == NULL ) return;
+
para = e->cursor_frame->paras[e->cursor_para];
offs = pos_trail_to_offset(para, e->cursor_pos, e->cursor_trail);
get_cursor_pos(e->cursor_frame, e->cursor_para, offs, &x, &y, &h);