diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-11-26 06:32:41 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-11-28 16:03:36 +0200 |
commit | b053aaa145cd29f6990bf1599243a0a0c6a5af17 (patch) | |
tree | 6d6273e7b0a7e56feb2595e1445128cb2719dcac | |
parent | 883b3e3a4f55936379e1c06b1fa09db270143ee0 (diff) |
listing: prevent invalid area in print_account()
-rw-r--r-- | src/components/mail/listing.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs index debcdf4b..7bfee75b 100644 --- a/src/components/mail/listing.rs +++ b/src/components/mail/listing.rs @@ -1468,6 +1468,9 @@ impl Listing { self.dirty = false; let mut y = get_y(upper_left); for a in &self.accounts { + if y > get_y(bottom_right) { + break; + } y += self.print_account(grid, (set_y(upper_left, y), bottom_right), &a, context); y += 3; } @@ -1484,9 +1487,7 @@ impl Listing { a: &AccountMenuEntry, context: &mut Context, ) -> usize { - if !is_valid_area!(area) { - debug!("BUG: invalid area in print_account"); - } + debug_assert!(is_valid_area!(area)); // Each entry and its index in the account let mailboxes: HashMap<MailboxHash, Mailbox> = context.accounts[a.index] .mailbox_entries |