Skip to content

Commit 37e496c

Browse files
committed
[lldb/Utility] Fix StructuredData::ParseJSONValue for null items
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 <[email protected]>
1 parent e0c7d3a commit 37e496c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lldb/source/Utility/StructuredData.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ static StructuredData::ObjectSP ParseJSONValue(json::Value &value) {
6969
if (auto d = value.getAsNumber())
7070
return std::make_shared<StructuredData::Float>(*d);
7171

72+
if (auto n = value.getAsNull())
73+
return std::make_shared<StructuredData::Null>();
74+
7275
return StructuredData::ObjectSP();
7376
}
7477

0 commit comments

Comments
 (0)