From 949fcfb9d154f0687ae76714ed12c091ed4dcf23 Mon Sep 17 00:00:00 2001 From: Dimitris-Rafail Katsampas Date: Wed, 11 Sep 2024 00:31:18 +0300 Subject: [PATCH 1/2] fix(ios): Unexpected end of JSON input --- src/https/request.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/https/request.ios.ts b/src/https/request.ios.ts index a372709..876a6db 100644 --- a/src/https/request.ios.ts +++ b/src/https/request.ios.ts @@ -177,7 +177,7 @@ class HttpsResponseLegacy implements IHttpsResponseLegacy { return data; } this.stringResponse = data; - this.jsonResponse = parseJSON(data); + this.jsonResponse = this.stringResponse ? parseJSON(data) : null; return this.jsonResponse as T; } toJSONAsync() { From 21e19b31efae41cec544bcc0ffa1d0b36accd7e6 Mon Sep 17 00:00:00 2001 From: Dimitris-Rafail Katsampas Date: Wed, 11 Sep 2024 00:33:23 +0300 Subject: [PATCH 2/2] chore: Minor reference change --- src/https/request.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/https/request.ios.ts b/src/https/request.ios.ts index 876a6db..85185f6 100644 --- a/src/https/request.ios.ts +++ b/src/https/request.ios.ts @@ -177,7 +177,7 @@ class HttpsResponseLegacy implements IHttpsResponseLegacy { return data; } this.stringResponse = data; - this.jsonResponse = this.stringResponse ? parseJSON(data) : null; + this.jsonResponse = data ? parseJSON(data) : null; return this.jsonResponse as T; } toJSONAsync() {