ui: fix crash when ThreadView is initiated without a ready mailbox

memfd
Manos Pitsidianakis 5 years ago
parent 43f89ef680
commit 37f95dd86d
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -110,12 +110,7 @@ impl CompactListing {
/// chosen.
fn refresh_mailbox(&mut self, context: &mut Context) {
self.dirty = true;
if self.cursor_pos == self.new_cursor_pos {
self.view.update(context);
} else {
self.view = ThreadView::new(self.cursor_pos, None, context);
}
let old_cursor_pos = self.cursor_pos;
if !(self.cursor_pos.0 == self.new_cursor_pos.0
&& self.cursor_pos.1 == self.new_cursor_pos.1)
{
@ -149,6 +144,12 @@ impl CompactListing {
return;
}
}
if old_cursor_pos == self.new_cursor_pos {
self.view.update(context);
} else {
self.view = ThreadView::new(self.new_cursor_pos, None, context);
}
let mailbox = &context.accounts[self.cursor_pos.0][self.cursor_pos.1]
.as_ref()
.unwrap();

Loading…
Cancel
Save