Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 564fd25

Browse files
committedMay 23, 2020
getApiResponsePayload return null in case response is 200 but empty
1 parent 58fd1ac commit 564fd25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/utils/tc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export async function getApiResponsePayload(res, shouldThrowError = true) {
4141
}
4242
}
4343
const x = (await res.json()).result;
44+
if (!x) {
45+
return null;
46+
}
4447
if ((!x.success)) {
4548
if (shouldThrowError) {
4649
throw new Error(x.content);

0 commit comments

Comments
 (0)
Please sign in to comment.