fix: Return synthetic name in get_security_desc

If the security is a synthetic (of course).

Bugs (fixed):
  * Changing limits in the risk ui causes sparkd to assert crash
This commit is contained in:
John Colvin committed 2025-01-05 20:15:10 +00:00
1 parent 86eba20d61
commit f372dd56b3
1 file changed
+4 -2
+4 -2
View File
@@ -170,8 +170,6 @@ std::string DomainSecurityUtils::get_exchange_id(const bts::api::Security &s) {
bool DomainSecurityUtils::get_security_desc(
const bts::api::Security &security, std::string &desc) {
switch (security.ExchangeData_case()) {
case bts::api::Security::ExchangeDataCase::EXCHANGEDATA_NOT_SET:
bts_assert(false);
case bts::api::Security::ExchangeDataCase::kCboe:
desc = security.cboe().security_desc();
break;
@@ -212,6 +210,10 @@ bool DomainSecurityUtils::get_security_desc(
desc = security.ftx().security_desc();
break;
default:
if (security.has_synthetic()) {
desc = security.synthetic().name();
break;
}
return false;
}
return true;