Skip to content

Commit

Permalink
[occ] Fix deserialization of ConfigEntry with empty value
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed May 31, 2024
1 parent 90977c6 commit f894c3c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions occ/plugin/litestructs/Transition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ bool OccLite::nopb::ConfigEntry::Serialize(rapidjson::Writer<rapidjson::StringBu

bool OccLite::nopb::ConfigEntry::Deserialize(const rapidjson::Value& obj)
{
if (!(obj.HasMember("key") && obj.HasMember("value")))
{
if (!obj.HasMember("key")) {
return false;
}
key = obj["key"].GetString();
value = obj["value"].GetString();
if (obj.HasMember("value")) {
value = obj["value"].GetString();
} else {
value = "";
}
return true;
}

0 comments on commit f894c3c

Please sign in to comment.