Skip to content

Commit

Permalink
Only check if response Contains [] not equal to
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0n00ps committed Oct 10, 2024
1 parent 339d544 commit 8342a8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OF DL/Helpers/APIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public async Task<JObject> GetUserInfoById(string endpoint)
//if the content creator doesnt exist, we get a 200 response, but the content isnt usable
//so let's not throw an exception, since "content creator no longer exists" is handled elsewhere
//which means we wont get loads of exceptions
if (body.Equals("[]"))
if (body.Contains("[]"))
return null;

JObject jObject = JObject.Parse(body);
Expand Down Expand Up @@ -290,7 +290,7 @@ public async Task<JObject> GetUserInfoById(string endpoint)
Subscriptions newSubscriptions = new();
string? loopbody = await BuildHeaderAndExecuteRequests(getParams, endpoint, new HttpClient());

if (!string.IsNullOrEmpty(loopbody) && loopbody.Trim() != "[]")
if (!string.IsNullOrEmpty(loopbody) && !loopbody.Contains("[]"))
{
newSubscriptions = JsonConvert.DeserializeObject<Subscriptions>(loopbody, m_JsonSerializerSettings);
}
Expand Down

0 comments on commit 8342a8e

Please sign in to comment.