From 6732f571e301754f6edc799b871f5e443eb9a9b8 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Thu, 16 Nov 2023 20:53:33 -0800 Subject: experimental fix: return `JSONValue::Type::Null` as "" (#3336) --- source/compiler-core/slang-json-value.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source') diff --git a/source/compiler-core/slang-json-value.cpp b/source/compiler-core/slang-json-value.cpp index 7a2375f2e..2e1eb6812 100644 --- a/source/compiler-core/slang-json-value.cpp +++ b/source/compiler-core/slang-json-value.cpp @@ -572,6 +572,10 @@ UnownedStringSlice JSONContainer::getString(const JSONValue& in) { return StringRepresentation::asSlice(in.stringRep); } + case JSONValue::Type::Null: + { + return UnownedStringSlice(); + } default: break; } @@ -609,6 +613,10 @@ UnownedStringSlice JSONContainer::getTransientString(const JSONValue& in) return unquoted; } } + case JSONValue::Type::Null: + { + return UnownedStringSlice(); + } } SLANG_ASSERT(!"Not a string type"); -- cgit v1.2.3