diff options
Diffstat (limited to 'include/openbmc_dbus_rest.hpp')
-rw-r--r-- | include/openbmc_dbus_rest.hpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index f0b72fbcc4..a2f68b4639 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -821,7 +821,11 @@ inline int convertJsonToDbus(sd_bus_message* m, const std::string& argType, { return -ERANGE; } - sd_bus_message_append_basic(m, argCode[0], doubleValue); + r = sd_bus_message_append_basic(m, argCode[0], doubleValue); + if (r < 0) + { + return r; + } } else if (argCode.starts_with("a")) { @@ -2328,10 +2332,10 @@ inline void const char* type = arg->Attribute("type"); if (name != nullptr && type != nullptr) { - argsArray.push_back({ - {"name", name}, - {"type", type}, - }); + nlohmann::json::object_t params; + params["name"] = name; + params["type"] = type; + argsArray.push_back(std::move(params)); } arg = arg->NextSiblingElement("arg"); } @@ -2373,7 +2377,11 @@ inline void return; } - convertDBusToJSON("v", msg, propertyItem); + int r = convertDBusToJSON("v", msg, propertyItem); + if (r < 0) + { + BMCWEB_LOG_ERROR("Couldn't convert vector to json"); + } }); } property = property->NextSiblingElement("property"); |