patch json decode to return null if something goes wrong

This commit is contained in:
Madpeter 2024-07-04 19:06:02 +01:00
parent 68681629a8
commit 73239fc408

View file

@ -20,7 +20,16 @@ namespace OpenMetaverse.StructuredData
public static OSD DeserializeJson(string json)
{
return DeserializeJson(JsonMapper.ToObject(json));
try
{
JsonData A = JsonMapper.ToObject(json);
return DeserializeJson(A);
}
catch
{
return null; // something fucky happened to the input
}
}
public static OSD DeserializeJson(JsonData json)