melib: fix crash in node_build(

embed
Manos Pitsidianakis 2019-04-04 00:29:56 +03:00
parent d7a4bd24c3
commit 43f89ef680
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 3 additions and 1 deletions

View File

@ -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();