summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-04-04 00:29:56 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-10 19:40:42 +0300
commit43f89ef680fc5b75726cb77e8ee51074e485ca86 (patch)
treed11c0d3fae0245df8b942ba05a7955ae40b65e45
parentd7a4bd24c3998955d7a52440c35c8647c756c58d (diff)
melib: fix crash in node_build(
-rw-r--r--melib/src/mailbox/thread.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/melib/src/mailbox/thread.rs b/melib/src/mailbox/thread.rs
index ee902519..78916e93 100644
--- a/melib/src/mailbox/thread.rs
+++ b/melib/src/mailbox/thread.rs
@@ -1338,7 +1338,9 @@ fn node_build(
indentation + 1
};
- let mut has_unseen = !collection[&thread_nodes[idx].message.unwrap()].is_seen();
+ let mut has_unseen = if let Some(msg) = thread_nodes[idx].message {
+ !collection[&msg].is_seen()
+ } else { false };
let mut child_vec: Vec<ThreadTree> = Vec::new();
thread_nodes[idx].len = thread_nodes[idx].children.len();