From d78348fd166e30e3702fdd472a5e896de2556d68 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 1 Sep 2024 21:31:12 +0300 Subject: [PATCH] Fixed crash in box for giveaway create when winners number is constant. --- .../info/channel_statistics/boosts/create_giveaway_box.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp index 53f1b9136b..c840ddc1a3 100644 --- a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp @@ -850,6 +850,9 @@ void CreateGiveawayBox( ? creditsOptionWinners(credits) : availablePresets; const auto count = values.size(); + if (count <= 1) { + return; + } const auto sliderWidth = sliderState->slider->width() - st::settingsScale.seekSize.width(); for (auto i = 0; i < count; i++) {