From b43191506af0854de50fc5fbe85b2f64c8336837 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 4 Feb 2019 18:02:52 +0300 Subject: [PATCH] Fix preview of color-only backgrounds. Regression was introduced in f506a5ea6c. --- Telegram/SourceFiles/boxes/background_box.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/boxes/background_box.cpp b/Telegram/SourceFiles/boxes/background_box.cpp index b1848a0f8f..e46471e279 100644 --- a/Telegram/SourceFiles/boxes/background_box.cpp +++ b/Telegram/SourceFiles/boxes/background_box.cpp @@ -368,8 +368,6 @@ BackgroundPreviewBox::BackgroundPreviewBox( true)) , _paper(paper) , _radial(animation(this, &BackgroundPreviewBox::step_radial)) { - Expects(_paper.thumbnail() != nullptr); - subscribe(Auth().downloaderTaskFinished(), [=] { update(); }); } @@ -540,10 +538,8 @@ void BackgroundPreviewBox::step_radial(TimeMs ms, bool timer) { } bool BackgroundPreviewBox::setScaledFromThumb() { - Expects(_paper.thumbnail() != nullptr); - const auto thumbnail = _paper.thumbnail(); - if (!thumbnail->loaded()) { + if (!thumbnail || !thumbnail->loaded()) { return false; } setScaledFromImage(PrepareScaledFromFull(