Fix preview of color-only backgrounds.

Regression was introduced in f506a5ea6c.
This commit is contained in:
John Preston 2019-02-04 18:02:52 +03:00
parent c47781c25a
commit b43191506a
1 changed files with 1 additions and 5 deletions

View File

@ -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(