fix: most frequent crashes

This commit is contained in:
AlexeyZavar 2024-10-05 05:30:56 +03:00
parent 45461836e1
commit 260678634e
3 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@ void MainList::unreadStateChanged(
const auto notifier = unreadStateChangeNotifier(notify); const auto notifier = unreadStateChangeNotifier(notify);
_unreadState += nowState - wasState; _unreadState += nowState - wasState;
if (updateCloudUnread) { if (updateCloudUnread) {
Assert(nowState.known); // Assert(nowState.known);
_cloudUnreadState += nowState - wasState; _cloudUnreadState += nowState - wasState;
finalizeCloudUnread(); finalizeCloudUnread();
} }

View file

@ -3527,7 +3527,7 @@ void HistoryWidget::messagesReceived(
const MTPmessages_Messages &messages, const MTPmessages_Messages &messages,
int requestId) { int requestId) {
// Expects(_history != nullptr); // Expects(_history != nullptr);
if (!_history) { if (!_history || !_peer) {
return; // AyuGram: fix crash when using `saveDeletedMessages` return; // AyuGram: fix crash when using `saveDeletedMessages`
} }

@ -1 +1 @@
Subproject commit 05601adb9f045f54ca8377d0555dae6d5ce48c7d Subproject commit b0beb8a162168ebeacafa2ff23b21addb4154e69