Fix crash in group members list.

This commit is contained in:
John Preston 2017-05-26 23:05:04 +03:00
parent 878e46c61a
commit 2c1e27add0
1 changed files with 5 additions and 3 deletions

View File

@ -176,9 +176,11 @@ void PeerListWidget::mousePressReleased(Qt::MouseButton button) {
ripple->lastStop();
}
if (pressed == _selected && pressedRemove == _selectedRemove && button == Qt::LeftButton) {
if (auto &callback = (pressedRemove ? _removedCallback : _selectedCallback)) {
callback(_items[pressed]->peer);
}
InvokeQueued(this, [this, pressedRemove, peer = _items[pressed]->peer] {
if (auto &callback = (pressedRemove ? _removedCallback : _selectedCallback)) {
callback(peer);
}
});
}
}
setCursor(_selectedRemove ? style::cur_pointer : style::cur_default);