Handle key not exists errors for voltage sensor

Check the key exists or not before access sensor map.

Change-Id: I0ac5d63ae981ec2f984b1d464e93508560a4d030


[ROCm/amdsmi commit: 7b107258ff]
Этот коммит содержится в:
Bill(Shuzhou) Liu authored and Shuzhou Liu committed 2023-07-05 09:25:27 -04:00
1 родитель f877896d3a
Коммит fb7085441b
1 file changed
+2
+2
Просмотреть файл
@@ -465,6 +465,8 @@ Monitor::getVoltSensorIndex(rsmi_voltage_type_t type) {
rsmi_voltage_type_t
Monitor::getVoltSensorEnum(uint64_t ind) {
// check if ind is a key or not
if (index_volt_type_map_.count(ind) == 0) return RSMI_VOLT_TYPE_INVALID;
return index_volt_type_map_.at(ind);
}