From e8933b1fc407ab7d9eb41fe12c9a291bbf41c544 Mon Sep 17 00:00:00 2001 From: claudiamurialdo <33756655+claudiamurialdo@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:40:44 -0300 Subject: [PATCH] Prevent FromJson exception on whitespace input Use string.IsNullOrWhiteSpace in FromJson to avoid exceptions on blank input Issue:207687 --- dotnet/src/dotnetframework/GxClasses/Helpers/JSONHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dotnet/src/dotnetframework/GxClasses/Helpers/JSONHelper.cs b/dotnet/src/dotnetframework/GxClasses/Helpers/JSONHelper.cs index 9d99a5d4f..cf0b46972 100644 --- a/dotnet/src/dotnetframework/GxClasses/Helpers/JSONHelper.cs +++ b/dotnet/src/dotnetframework/GxClasses/Helpers/JSONHelper.cs @@ -262,7 +262,7 @@ public static T ReadJSON(string json, GXBaseCollection M { try { - if (!string.IsNullOrEmpty(json)) + if (!string.IsNullOrWhiteSpace(json)) { return GXJsonSerializer.Instance.ReadJSON(json); } @@ -283,7 +283,7 @@ public static T ReadJavascriptJSON(string json, GXBaseCollection(json); @@ -449,7 +449,7 @@ public static T Deserialize(string kbObject, Encoding encoding, IEnumerable(string kbObject, Encoding encoding, IEnumerable knownTypes, T defaultValue, DataContractJsonSerializerSettings settings) where T : class { - if (!string.IsNullOrEmpty(kbObject)) + if (!string.IsNullOrWhiteSpace(kbObject)) { try {