mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix possible crash on empty options from the server.
This commit is contained in:
parent
de11987312
commit
58cedb796e
1 changed files with 3 additions and 0 deletions
|
@ -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(
|
||||||
|
|
Loading…
Add table
Reference in a new issue