Skip to content

Commit

Permalink
fix: test for response before accessing properties (#83)
Browse files Browse the repository at this point in the history
* fix: test for response before accessing properties

* Update index.js
  • Loading branch information
jithine authored Mar 2, 2020
1 parent 1f4be35 commit 573fb94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class ExecutorQueue extends Executor {
if (!err && response.statusCode === 201) {
return resolve(response);
}
if (response.statusCode !== 201) {
if (response && response.statusCode !== 201) {
return reject(JSON.stringify(response.body));
}

Expand Down Expand Up @@ -272,7 +272,7 @@ class ExecutorQueue extends Executor {
return resolve(response);
}

if (response.statusCode !== 200) {
if (response && response.statusCode !== 200) {
return reject(JSON.stringify(response.body));
}

Expand Down

0 comments on commit 573fb94

Please sign in to comment.