Skip to content

Commit a1242f3

Browse files
committed
Fix daily_revenue_per_user handling.
1 parent 916a22b commit a1242f3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

td/telegram/ReferralProgramInfo.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ ReferralProgramInfo::ReferralProgramInfo(telegram_api::object_ptr<telegram_api::
1616
if (program != nullptr) {
1717
parameters_ = ReferralProgramParameters(program->commission_permille_, program->duration_months_);
1818
end_date_ = program->end_date_;
19-
if (program->daily_revenue_per_user_->get_id() != telegram_api::starsAmount::ID) {
20-
LOG(ERROR) << "Receive " << to_string(program);
21-
} else {
22-
daily_star_amount_ =
23-
StarAmount(telegram_api::move_object_as<telegram_api::starsAmount>(program->daily_revenue_per_user_), true);
19+
if (program->daily_revenue_per_user_ != nullptr) {
20+
if (program->daily_revenue_per_user_->get_id() != telegram_api::starsAmount::ID) {
21+
LOG(ERROR) << "Receive " << to_string(program);
22+
} else {
23+
daily_star_amount_ =
24+
StarAmount(telegram_api::move_object_as<telegram_api::starsAmount>(program->daily_revenue_per_user_), true);
25+
}
2426
}
2527
}
2628
}

0 commit comments

Comments
 (0)