diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2168eacca..c2c9e7964 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1918,11 +1918,6 @@ void History::addOlderSlice(const QVector &slice, const QVectorconstData() : 0, *groupsIt = groupsBegin, *groupsEnd = (isChannel() && collapsed) ? (groupsBegin + collapsed->size()) : 0; HistoryItem *oldFirst = 0, *last = 0; - if (!blocks.isEmpty()) { - t_assert(blocks.size() > 1); - oldFirst = blocks.at(1)->items.front(); - } - HistoryBlock *block = new HistoryBlock(this); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (QVector::const_iterator i = slice.cend(), e = slice.cbegin(); i != e;) { @@ -1947,6 +1942,10 @@ void History::addOlderSlice(const QVector &slice, const QVector 1); + oldFirst = blocks.at(1)->items.front(); + } while (oldFirst && last && oldFirst->type() == HistoryItemGroup && last->type() == HistoryItemGroup) { static_cast(last)->uniteWith(static_cast(oldFirst)); oldFirst->destroy();