Skip to content

Commit

Permalink
Fix a NullReferenceException when no headers (#3116)
Browse files Browse the repository at this point in the history
Co-authored-by: Ashley Canning <ashley.canning@decentraland.org>
  • Loading branch information
AnsisMalins and m3taphysics authored Jan 20, 2025
1 parent 1634a85 commit dd87906
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ async UniTask<ResponseToJs> FetchAsync(CancellationToken ct)
ISimpleFetchApi.Response response = await api.FetchAsync(requestMethod, url, headers, hasBody, body, redirect, timeout, webController, ct);

var headersToJs = new PropertyBag();
foreach (var header in response.Headers)
headersToJs.Add(header.Key, header.Value);

if (response.Headers != null)
foreach (var header in response.Headers)
headersToJs.Add(header.Key, header.Value);

return new ResponseToJs
{
Expand Down

0 comments on commit dd87906

Please sign in to comment.