Skip to content

Commit

Permalink
fix: prevent failing when response without body
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Feb 25, 2025
1 parent c765a14 commit 45228f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/web/src/package/ui/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ type Params = {

async function getResObject(r: Response) {
const textBody = await r.text();
if (!textBody) {
return undefined;
}
try {
return JSON.parse(textBody);
} catch (e) {
Expand Down

0 comments on commit 45228f0

Please sign in to comment.