Skip to content

Commit

Permalink
fix: Commands.getByName type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-karpov committed Jul 18, 2018
1 parent 4ac4f03 commit 42952f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export default class Commands implements ICommands {
public getByName(name) {
if (!name) { throw new Error('Name is not specified') }
return this._strings.find((command) => {
return command.name.toLowerCase() === name.toLowerCase()
})
return typeof command.name === 'string' && command.name.toLowerCase() === name.toLowerCase()
})
}

get length() {
Expand Down

0 comments on commit 42952f5

Please sign in to comment.