Refactor error handling in JsonExtensions

Replaced the `catch` block in the `JsonExtensions` class to suppress exceptions silently instead of returning the original string when JSON deserialization fails. The `return str;` statement was moved outside the `try-catch` block, making it the default return value. This change removes explicit handling of invalid JSON inputs and may impact debugging.
This commit is contained in:
tekh 2025-12-04 13:54:48 +01:00
parent d02bebc6e2
commit dbfae5cdad

View File

@ -43,10 +43,7 @@ public static class JsonExtensions
{ {
return JsonToDynamic(JsonSerializer.Deserialize<JsonElement>(str)); return JsonToDynamic(JsonSerializer.Deserialize<JsonElement>(str));
} }
catch catch { }
{
return str; // Not valid JSON, return original string
}
} }
return str; return str;
default: default: