Fix possible crash on empty options from the server.

This commit is contained in:
John Preston 2023-01-20 16:54:35 +04:00
parent de11987312
commit 58cedb796e
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,9 @@ namespace Api {
template<typename Option>
[[nodiscard]] Data::SubscriptionOptions SubscriptionOptionsFromTL(
const QVector<Option> &tlOptions) {
if (tlOptions.isEmpty()) {
return {};
}
auto result = Data::SubscriptionOptions();
const auto monthlyAmount = [&] {
const auto &min = ranges::min_element(