Skip to content

Commit 1ab3bd4

Browse files
Merge pull request #55 from yonaichin/master
Avoid undefined error in batch operation
2 parents 864b425 + af2eeae commit 1ab3bd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/requests/helpers/parseResponse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function parseBatchResponse(response, parseParams, requestNumber) {
148148
result.push(isNaN(plainContent) ? plainContent : parseInt(plainContent));
149149
}
150150
else
151-
if (parseParams.length && parseParams[requestNumber].hasOwnProperty('valueIfEmpty')) {
151+
if (parseParams.length && parseParams[requestNumber] && parseParams[requestNumber].hasOwnProperty('valueIfEmpty')) {
152152
result.push(parseParams[requestNumber].valueIfEmpty);
153153
}
154154
else {
@@ -213,4 +213,4 @@ module.exports = function parseResponse(response, responseHeaders, parseParams)
213213
}
214214

215215
return parseResult;
216-
};
216+
};

0 commit comments

Comments
 (0)