2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fixed possible crash on local clearing of filters.

This commit is contained in:
23rd
2022-12-12 15:27:32 +03:00
committed by John Preston
parent 8db8bc466e
commit 6118ced862

View File

@@ -538,7 +538,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
const auto id = row.filter.id();
const auto removed = row.removed;
const auto i = ranges::find(list, id, &Data::ChatFilter::id);
if (removed && i == end(list)) {
if (removed && (i == end(list) || id == FilterId(0))) {
continue;
} else if (!removed && i != end(list) && *i == row.filter) {
order.push_back(id);