Fix deserialization errors preventing context menus to open

Not a proper fix but Mono runtime seems to silently ignore this error when clipboard contains garbage data.
This commit is contained in:
2022-12-26 11:53:16 +02:00
parent dfc69c9c8e
commit 3f14d4bf64

View File

@@ -616,7 +616,14 @@ namespace FlaxEditor.CustomEditors
else
{
// Default
obj = JsonConvert.DeserializeObject(text, TypeUtils.GetType(Values.Type), JsonSerializer.Settings);
try
{
obj = JsonConvert.DeserializeObject(text, TypeUtils.GetType(Values.Type), JsonSerializer.Settings);
}
catch
{
obj = null;
}
}
if (obj == null || Values.Type.IsInstanceOfType(obj))