Skip to content

Commit db15b07

Browse files
committed
Fix: claim method returns an error if the port is not valid
1 parent 5aa1fb2 commit db15b07

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/harbor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ Harbor.prototype.claim = function (name, port, cb) {
147147
self.emit('claim', name, port);
148148
cb(null, port);
149149
});
150+
} else {
151+
return cb(new Error('No valid port.'));
150152
}
151153
};
152154

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "harbor",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "TCP port availability and assignment utility.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)