Skip to content

Commit

Permalink
Update nb.js
Browse files Browse the repository at this point in the history
Big fix: TypeError when no host specified.
  • Loading branch information
ebaauw committed Dec 1, 2020
1 parent 93e0449 commit add8115
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/nb.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,6 @@ class Main extends homebridgeLib.CommandLineTool {
})
parser.remaining((list) => { clargs.args = list })
parser.parse()
if (clargs.options.host.split(':').length === 1) {
clargs.options.host += ':8080'
}
return clargs
}

Expand All @@ -339,6 +336,9 @@ class Main extends homebridgeLib.CommandLineTool {
if (clargs.options.host == null) {
this.fatal(`Missing host. Set ${b('NB_HOST')} or specify ${b('-H')}.`)
}
if (clargs.options.host.split(':').length === 1) {
clargs.options.host += ':8080'
}
this.client = new NbClient(clargs.options)
this.client.on('request', (id, method, resource, body, url) => {
this.debug('nuki bridge request %d: %s %s', id, method, resource)
Expand Down

1 comment on commit add8115

@ebaauw
Copy link
Owner Author

@ebaauw ebaauw commented on add8115 Dec 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #4.

Please sign in to comment.