Skip to content

Commit 37f717d

Browse files
committed
Merge branch 'master' of https://github.com/emyhrberg/SkipSelect
2 parents e2208dd + a713fe2 commit 37f717d

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

Helpers/ClientDataJsonHelper.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,27 @@ private static List<ClientDataJson> GetListFromJson(StreamReader reader)
155155
{
156156
List<ClientDataJson> listJson = new List<ClientDataJson>();
157157
string jsonString = reader.ReadToEnd();
158-
159-
if (string.IsNullOrEmpty(jsonString))
158+
try
160159
{
161-
listJson = [];
160+
if (string.IsNullOrEmpty(jsonString))
161+
{
162+
return listJson;
163+
}
164+
else
165+
{
166+
listJson = JsonSerializer.Deserialize<List<ClientDataJson>>(jsonString);
167+
}
168+
return listJson;
162169
}
163-
else
170+
catch
164171
{
165-
listJson = JsonSerializer.Deserialize<List<ClientDataJson>>(jsonString);
172+
Log.Warn($"Error of reading list of Client Data; Value: {jsonString}");
173+
return listJson;
166174
}
175+
176+
177+
167178

168-
return listJson;
169179
}
170180
}
171181
}

0 commit comments

Comments
 (0)