diff options
author | Thomas White <taw@bitwiz.org.uk> | 2018-02-23 16:27:26 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-02-23 18:32:47 +0100 |
commit | 671b86e76f81e2f77be22514c610b26f0e6901cb (patch) | |
tree | 27b74262558a72032be8e9983a89b7d4ca9be1e2 /src/sc_editor.c | |
parent | 468a1463ab69c458c3f96b11b8fb5b45d84ffe73 (diff) |
Complain if frame can't be created
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index 75d29b7..493e076 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -1438,12 +1438,16 @@ static gboolean button_release_sig(GtkWidget *da, GdkEventButton *event, fr = create_frame(e, e->start_corner_x, e->start_corner_y, e->drag_corner_x - e->start_corner_x, e->drag_corner_y - e->start_corner_y); - check_paragraph(fr, e->pc, sc_block_child(fr->scblocks)); - e->selection = fr; - e->cursor_frame = fr; - e->cursor_para = 0; - e->cursor_pos = 0; - e->cursor_trail = 0; + if ( fr != NULL ) { + check_paragraph(fr, e->pc, sc_block_child(fr->scblocks)); + e->selection = fr; + e->cursor_frame = fr; + e->cursor_para = 0; + e->cursor_pos = 0; + e->cursor_trail = 0; + } else { + fprintf(stderr, "Failed to create frame!\n"); + } break; case DRAG_REASON_IMPORT : |