Skip to content

Commit

Permalink
Fixed an issue with an empty response body from commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcputney committed Oct 27, 2024
1 parent 1750545 commit 92c1fbd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/constants/default_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export const DefaultSettings: Settings = {
fetchMode: "cors",
responseHandler: async function (response: Response): Promise<ResultObject> {
if (typeof response !== "undefined") {
const httpResult = JSON.parse(await response.text());
const responseText = await response.text();
let httpResult = null;
if (responseText) {
httpResult = JSON.parse(responseText);
}
if (
httpResult === null ||
!{}.hasOwnProperty.call(httpResult, "result")
Expand Down

0 comments on commit 92c1fbd

Please sign in to comment.