diff --git a/i2c_smbus/i2c_smbus_i801.cpp b/i2c_smbus/i2c_smbus_i801.cpp index 09b011c7..dade359c 100644 --- a/i2c_smbus/i2c_smbus_i801.cpp +++ b/i2c_smbus/i2c_smbus_i801.cpp @@ -544,7 +544,7 @@ bool i2c_smbus_i801_detect() std::smatch matches; // Query the StartingAddress for the matching device ID and use it to enumerate the bus - if (std::regex_search(q_res_PNPAllocatedResource[0]["Antecedent"], matches, rgx2)) + if (!q_res_PNPAllocatedResource.empty() && std::regex_search(q_res_PNPAllocatedResource[0]["Antecedent"], matches, rgx2)) { unsigned int IORangeStart = std::stoi(matches[1].str());