Skip to content

Commit 0f1d6d6

Browse files
First check if callback is defined before calling it
1 parent ab9a10c commit 0f1d6d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ TestingBot.prototype.request = function(req_data, callback) {
162162
} else {
163163
error = response.body;
164164
}
165-
callback(error, responseBody);
165+
if (callback) {
166+
callback(error, responseBody);
167+
}
166168
});
167169
};
168170

0 commit comments

Comments
 (0)