Check for empty JSON before processing
Check has been added to check for empty JSON before processing it.
In some patch sets CI is complaining for the check, hence it has been
added.
Change-Id: I5a9966418c9b5155356e7b3edfa374e0a62fd6b6
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
diff --git a/vpd-manager/include/utility/vpd_specific_utility.hpp b/vpd-manager/include/utility/vpd_specific_utility.hpp
index b950365..e366963 100644
--- a/vpd-manager/include/utility/vpd_specific_utility.hpp
+++ b/vpd-manager/include/utility/vpd_specific_utility.hpp
@@ -964,10 +964,13 @@
}
};
- // iterate through all common interfaces and populate interface map
- std::for_each(i_commonInterfaceJson.items().begin(),
- i_commonInterfaceJson.items().end(),
- l_populateInterfaceMap);
+ if (!i_commonInterfaceJson.empty())
+ {
+ // iterate through all common interfaces and populate interface map
+ std::for_each(i_commonInterfaceJson.items().begin(),
+ i_commonInterfaceJson.items().end(),
+ l_populateInterfaceMap);
+ }
}
catch (const std::exception& l_ex)
{