Skip to content

Commit

Permalink
Fix panic in apply_difference_type
Browse files Browse the repository at this point in the history
Closes #258.
  • Loading branch information
Lonami committed Aug 21, 2024
1 parent 8e215c0 commit 7e242fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/grammers-session/src/message_box/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,14 @@ impl MessageBox {
chat_hashes: &mut ChatHashCache,
) -> defs::UpdateAndPeers {
self.map.get_mut(&Entry::AccountWide).unwrap().pts = state.pts;
self.map.get_mut(&Entry::SecretChats).unwrap().pts = state.qts;
self.map
.entry(Entry::SecretChats)
// AccountWide affects SecretChats, but this may not have been initialized yet (#258)
.or_insert_with(|| State {
pts: NO_PTS,
deadline: next_updates_deadline(),
})
.pts = state.qts;
self.date = state.date;
self.seq = state.seq;

Expand Down

0 comments on commit 7e242fd

Please sign in to comment.