Check for empty interface property pair
This commit adds check for empty interface property pair before
processing it. In some patch sets CI is complaining for the check, hence
it has been added.
Test:
```
- Do vpd-tool writeKeyword operation on /system/chassis/motherboard's
VINI record PN keyword
- Observe the write operation is successful and
/system/chassis's Decorator.Asset PartNumber property is also updated
with the same value
```
Change-Id: Ib3b8ca67684746dc8728c1cda89cfee72a62b191
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/include/utility/vpd_specific_utility.hpp b/vpd-manager/include/utility/vpd_specific_utility.hpp
index a3f8921..4a821d2 100644
--- a/vpd-manager/include/utility/vpd_specific_utility.hpp
+++ b/vpd-manager/include/utility/vpd_specific_utility.hpp
@@ -939,6 +939,11 @@
auto l_populateInterfaceMap = [&l_ipzData = std::as_const(l_ipzData),
&l_interfaceMap](
const auto& l_interfacesPropPair) {
+ if (l_interfacesPropPair.value().empty())
+ {
+ return;
+ }
+
// find matching property value pair
const auto l_matchPropValuePairIt = std::find_if(
l_interfacesPropPair.value().items().begin(),