Fix a crash in media spoilers.

This commit is contained in:
John Preston 2022-12-26 10:47:22 +04:00
parent 1bb6b07515
commit 43f0da683f
1 changed files with 8 additions and 0 deletions

View File

@ -540,6 +540,10 @@ MediaPhoto::MediaPhoto(
, _photo(photo)
, _spoiler(spoiler) {
parent->history()->owner().registerPhotoItem(_photo, parent);
if (_spoiler) {
Ui::PrepareImageSpoiler();
}
}
MediaPhoto::MediaPhoto(
@ -753,6 +757,10 @@ MediaFile::MediaFile(
_emoji = emoji->text();
}
}
if (_spoiler) {
Ui::PrepareImageSpoiler();
}
}
MediaFile::~MediaFile() {