summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2023-11-16 20:53:33 -0800
committerGitHub <noreply@github.com>2023-11-16 20:53:33 -0800
commit6732f571e301754f6edc799b871f5e443eb9a9b8 (patch)
treed11a6a140ea5d8edd90cbd9de743345681f9514b /source
parent4c78efd0c34442866f20e9d00bbb6908115c9a01 (diff)
experimental fix: return `JSONValue::Type::Null` as "" (#3336)
Diffstat (limited to 'source')
-rw-r--r--source/compiler-core/slang-json-value.cpp8
1 files changed, 8 insertions, 0 deletions
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");