Handle key not exists errors for voltage sensor
Check the key exists or not before access sensor map. Change-Id: I0ac5d63ae981ec2f984b1d464e93508560a4d030
This commit is contained in:
committed by
Shuzhou Liu
parent
78faf411f8
commit
7b107258ff
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user