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]
Bu işleme şunda yer alıyor:
Bill(Shuzhou) Liu
2023-06-30 15:16:30 -05:00
işlemeyi yapan: Shuzhou Liu
ebeveyn f877896d3a
işleme fb7085441b
+2
Dosyayı Görüntüle
@@ -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);
}