Removed hotfix for System.AccessViolationException error

This commit is contained in:
Chomp
2025-08-28 11:32:21 +01:00
parent 5a609835a4
commit bbd0b50d34
@@ -53,15 +53,6 @@ public class HttpResponseUtil(JsonUtil jsonUtil, ServerLocalisationService serve
/// <returns>response as string</returns>
public string GetBody<T>(T data, BackendErrorCodes err = BackendErrorCodes.None, string? errmsg = null, bool sanitize = true)
{
// No idea why, this fixes an AccessViolationException on release builds
// Cast explicitly as object fixes this, exception happens in System.Text.Json?
#if RELEASE
if (typeof(T) == typeof(bool))
{
return sanitize ? ClearString(GetUnclearedBody<object>(data, err, errmsg)) : GetUnclearedBody<object>(data, err, errmsg);
}
#endif
return sanitize ? ClearString(GetUnclearedBody(data, err, errmsg)) : GetUnclearedBody(data, err, errmsg);
}