From 1c9278d050df9dbe53bd0b4b932dcf9e95cb5ad8 Mon Sep 17 00:00:00 2001 From: bleizix Date: Wed, 8 Oct 2025 21:23:24 +0500 Subject: [PATCH] fix: crashes --- .../SourceFiles/ayu/ui/components/now_playing.cpp | 4 ++-- .../info/profile/info_profile_cover.cpp | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ui/components/now_playing.cpp b/Telegram/SourceFiles/ayu/ui/components/now_playing.cpp index 11e43c2add..d84b1fe18e 100644 --- a/Telegram/SourceFiles/ayu/ui/components/now_playing.cpp +++ b/Telegram/SourceFiles/ayu/ui/components/now_playing.cpp @@ -115,8 +115,8 @@ Cover GetCurrentCover( }; if (const auto normal = dataMedia->thumbnail()) { return { - .pixToDraw = normal->pixSingle(scaled(normal), args), - .pixToBg = normal->pix(), + .pixToDraw = normal->pixNoCache(scaled(normal), args), + .pixToBg = normal->pixNoCache(), .noCover = false }; } /*else if (const auto blurred = dataMedia->thumbnailInline()) { diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp index 9598b53a95..bbc7d0a77f 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp @@ -917,7 +917,7 @@ void Cover::setupSavedMusic() { dispatchToMainThread( [=] { - if (const auto strong = weak.get()) { + if (const auto strong = weak.get(); strong && strong->_musicButton) { strong->_musicButton->show(anim::type::normal); } }, @@ -928,15 +928,19 @@ void Cover::setupSavedMusic() { widthValue() | rpl::start_with_next( [=](int newWidth) { - _musicButton->resizeToWidth(newWidth); - _musicButton->moveToLeft(0, _st.height, newWidth); - resize(width(), _st.height + _musicButton->height()); + if (_musicButton) { + _musicButton->resizeToWidth(newWidth); + _musicButton->moveToLeft(0, _st.height, newWidth); + resize(width(), _st.height + _musicButton->height()); + } }, _musicButton->lifetime()); _musicButton->heightValue() | rpl::start_with_next( [=] { - resize(width(), _st.height + _musicButton->height()); + if (_musicButton) { + resize(width(), _st.height + _musicButton->height()); + } }, _musicButton->lifetime()); } else {