Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52dc1d1

Browse files
committed
Output true if there is no responseText
Upon successful response, if there is no responseText output true (Stops a callback errors being created with some API calls when actually everything went well)
1 parent 5d069f3 commit 52dc1d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

github.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
xhr.onreadystatechange = function () {
2121
if (this.readyState == 4) {
2222
if (this.status >= 200 && this.status < 300 || this.status === 304) {
23-
cb(null, raw ? this.responseText : JSON.parse(this.responseText));
23+
cb(null, raw ? this.responseText : this.responseText ? JSON.parse(this.responseText) : true);
2424
} else {
2525
cb(this.status);
2626
}

0 commit comments

Comments
 (0)