Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit df86b1d

Browse files
committed
Immediately fail if options object is invalid
1 parent d0327d9 commit df86b1d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/check.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ const rest = (options, callback) => {
134134
* @param callback {function|undefined} The callback function.
135135
*/
136136
module.exports = (options, callback) => {
137+
if (options === null || options === undefined) {
138+
throw new Error('options object must not be null or undefined!');
139+
}
140+
137141
// get options
138142
options.token = options.token || process.env.GITHUB_API_TOKEN || undefined;
139143
if (options.reduceTraffic) {

0 commit comments

Comments
 (0)