diff options
author | Thomas White <taw@bitwiz.me.uk> | 2018-04-23 17:57:10 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2018-04-23 17:57:10 +0200 |
commit | d27784a955a9c775b8ba75d88c6d952c5cfc6579 (patch) | |
tree | 60b02e6eb23f614f551aea7968f6524425aaf5b5 | |
parent | ef49ac2a7919d9284e2db4c34b5fccf3d636f72e (diff) |
Avoid crashiness if deletion SCBlock ends up as NULL
-rw-r--r-- | src/frame.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index ff00530..785ec7b 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1473,6 +1473,14 @@ void delete_text_from_frame(struct frame *fr, struct edit_pos p1, struct edit_po wrap_end = p2.para; printf("SCBlocks %p to %p\n", p1scblock, p2scblock); + if ( p1scblock == NULL ) { + fprintf(stderr, "Starting block NULL. Not deleting.\n"); + return; + } + if ( p2scblock == NULL ) { + fprintf(stderr, "Ending block NULL. Not deleting.\n"); + return; + } //show_sc_blocks(p1scblock); if ( (p1scblock == p2scblock) && (type1 == PARA_TYPE_TEXT) ) { |