Fix crash in shared media save state.

This commit is contained in:
John Preston 2017-11-30 12:15:21 +04:00
parent ad6ddcb507
commit 5b7059dccd
1 changed files with 6 additions and 4 deletions

View File

@ -930,11 +930,13 @@ void ListWidget::markLayoutsStale() {
void ListWidget::saveState(not_null<Memento*> memento) {
if (_universalAroundId != kDefaultAroundId) {
memento->setAroundId(computeFullId(_universalAroundId));
memento->setIdsLimit(_idsLimit);
auto state = countScrollState();
memento->setScrollTopItem(computeFullId(state.item));
memento->setScrollTopShift(state.shift);
if (state.item) {
memento->setAroundId(computeFullId(_universalAroundId));
memento->setIdsLimit(_idsLimit);
memento->setScrollTopItem(computeFullId(state.item));
memento->setScrollTopShift(state.shift);
}
}
}