mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
Fix possible crash on empty options from the server.
This commit is contained in:
@@ -21,6 +21,9 @@ namespace Api {
|
|||||||
template<typename Option>
|
template<typename Option>
|
||||||
[[nodiscard]] Data::SubscriptionOptions SubscriptionOptionsFromTL(
|
[[nodiscard]] Data::SubscriptionOptions SubscriptionOptionsFromTL(
|
||||||
const QVector<Option> &tlOptions) {
|
const QVector<Option> &tlOptions) {
|
||||||
|
if (tlOptions.isEmpty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
auto result = Data::SubscriptionOptions();
|
auto result = Data::SubscriptionOptions();
|
||||||
const auto monthlyAmount = [&] {
|
const auto monthlyAmount = [&] {
|
||||||
const auto &min = ranges::min_element(
|
const auto &min = ranges::min_element(
|
||||||
|
Reference in New Issue
Block a user