mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Fixed possible crash on summarizing of caption from grouped media.
This commit is contained in:
@@ -1677,6 +1677,11 @@ void Element::validateText() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Albums may show text of a different item than the parent one.
|
||||
// Media::itemForText may initialize data within the object.
|
||||
_textItem = _media ? _media->itemForText() : item.get();
|
||||
|
||||
const auto &summary = item->summaryEntry();
|
||||
const auto summaryShownWas = (_flags & Flag::SummaryShown) != 0;
|
||||
const auto summaryShownNow = !summary.result.empty() && summary.shown;
|
||||
@@ -1684,7 +1689,6 @@ void Element::validateText() {
|
||||
if (summaryShownNow) {
|
||||
_flags |= Flag::SummaryShown;
|
||||
if (summaryShownChanged) {
|
||||
_textItem = item;
|
||||
setTextWithLinks(summary.result);
|
||||
}
|
||||
return;
|
||||
@@ -1692,8 +1696,6 @@ void Element::validateText() {
|
||||
_flags &= ~Flag::SummaryShown;
|
||||
}
|
||||
|
||||
// Albums may show text of a different item than the parent one.
|
||||
_textItem = _media ? _media->itemForText() : item.get();
|
||||
if (!_textItem) {
|
||||
if (!_text.isEmpty()) {
|
||||
setTextWithLinks({});
|
||||
|
||||
Reference in New Issue
Block a user