Skip to content

Commit

Permalink
[lldb/Utility] Fix StructuredData::ParseJSONValue for null items
Browse files Browse the repository at this point in the history
This patch fixes the JSON parser for StructuredData to handle JSON null
entries.

Differential Revision: https://reviews.llvm.org/D135616

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
  • Loading branch information
medismailben committed Nov 3, 2022
1 parent 268628c commit 9060896
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lldb/source/Utility/StructuredData.cpp
Expand Up @@ -69,6 +69,9 @@ static StructuredData::ObjectSP ParseJSONValue(json::Value &value) {
if (auto d = value.getAsNumber())
return std::make_shared<StructuredData::Float>(*d);

if (auto n = value.getAsNull())
return std::make_shared<StructuredData::Null>();

return StructuredData::ObjectSP();
}

Expand Down

0 comments on commit 9060896

Please sign in to comment.