2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix crash in EditCaptionBox.

This commit is contained in:
John Preston
2019-02-17 12:31:04 +04:00
parent 771a51224e
commit 7c1704e68b
8 changed files with 86 additions and 39 deletions

View File

@@ -115,6 +115,9 @@ EditCaptionBox::EditCaptionBox(
_refreshThumbnail();
}
} else {
if (!image) {
image = Image::BlankMedia();
}
int32 maxW = 0, maxH = 0;
if (_animated) {
int32 limitW = st::sendMediaPreviewSize;
@@ -201,7 +204,9 @@ EditCaptionBox::EditCaptionBox(
? _thumbnailImage->loaded()
: true;
subscribe(Auth().downloaderTaskFinished(), [=] {
if (!_thumbnailImageLoaded && _thumbnailImage->loaded()) {
if (!_thumbnailImageLoaded
&& _thumbnailImage
&& _thumbnailImage->loaded()) {
_thumbnailImageLoaded = true;
_refreshThumbnail();
update();