Skip to content

Commit

Permalink
fix(android): prevent null exception
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Apr 10, 2024
1 parent 30e55bd commit 73817e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/https/request.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,10 @@ export function createRequest(opts: HttpsRequestOptions, useLegacy: boolean = tr
const message = OkHttpResponse.getMessage(response);
const statusCode = OkHttpResponse.getStatusCode(response);
const getHeaders = function () {
const heads = OkHttpResponse.getHeaders(response);
return JSON.parse(heads);
if (response) {
const heads = OkHttpResponse.getHeaders(response);
return JSON.parse(heads);
}
};
if (useLegacy) {
const nResponse = new OkHttpResponse(responseBody);
Expand Down

0 comments on commit 73817e3

Please sign in to comment.