Skip to content

Commit 3f00beb

Browse files
committed
Add missing checks fpr database existence.
1 parent 4c1f6d6 commit 3f00beb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

td/telegram/ContactsManager.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9792,7 +9792,9 @@ void ContactsManager::get_channel_recommendations(DialogId dialog_id, bool retur
97929792
} else {
97939793
LOG(INFO) << "Drop cache for similar chats of " << dialog_id;
97949794
channel_recommended_dialogs_.erase(it);
9795-
G()->td_db()->get_sqlite_pmc()->erase(get_channel_recommendations_database_key(channel_id), Auto());
9795+
if (G()->use_message_database()) {
9796+
G()->td_db()->get_sqlite_pmc()->erase(get_channel_recommendations_database_key(channel_id), Auto());
9797+
}
97969798
}
97979799
use_database = false;
97989800
}
@@ -12838,7 +12840,9 @@ void ContactsManager::update_channel(Channel *c, ChannelId channel_id, bool from
1283812840
if (c->had_read_access && !have_read_access) {
1283912841
send_closure_later(G()->messages_manager(), &MessagesManager::on_dialog_deleted, DialogId(channel_id),
1284012842
Promise<Unit>());
12841-
G()->td_db()->get_sqlite_pmc()->erase(get_channel_recommendations_database_key(channel_id), Promise<Unit>());
12843+
if (G()->use_message_database()) {
12844+
G()->td_db()->get_sqlite_pmc()->erase(get_channel_recommendations_database_key(channel_id), Promise<Unit>());
12845+
}
1284212846
} else if (!from_database && c->was_member != is_member) {
1284312847
DialogId dialog_id(channel_id);
1284412848
send_closure_later(G()->messages_manager(), &MessagesManager::force_create_dialog, dialog_id, "update channel",

0 commit comments

Comments
 (0)