diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2003-12-10 00:48:57 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2003-12-10 00:48:57 +0000 |
commit | 8896cc94635b076d22654576d3b7ba2f01bf942a (patch) | |
tree | bb050973afdf7be1112d2e034e230a0a07a213a9 /thread.c | |
parent | 173056e22474688ca471a78e39a34f0dc9a13fa6 (diff) |
Avoid NULL pointer deference in threading code.
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -72,7 +72,7 @@ static int need_display_subject (CONTEXT *ctx, HEADER *hdr) return (1); } } - + /* if we have no visible parent or previous sibling, display the subject */ return (1); } @@ -947,16 +947,19 @@ void mutt_sort_threads (CONTEXT *ctx, int init) if (!option (OPTSTRICTTHREADS)) pseudo_threads (ctx); - ctx->tree = mutt_sort_subthreads (ctx->tree, init); - - /* restore the oldsort order. */ - Sort = oldsort; + if (ctx->tree) + { + ctx->tree = mutt_sort_subthreads (ctx->tree, init); - /* Put the list into an array. */ - linearize_tree (ctx); + /* restore the oldsort order. */ + Sort = oldsort; + + /* Put the list into an array. */ + linearize_tree (ctx); - /* Draw the thread tree. */ - mutt_draw_tree (ctx); + /* Draw the thread tree. */ + mutt_draw_tree (ctx); + } } static HEADER *find_virtual (THREAD *cur, int reverse) |