Skip to content

Commit

Permalink
Fix error when invalid language passed.
Browse files Browse the repository at this point in the history
`this.resources` is not defined at the time this error would be thrown, so we use `resources` which is defined.
  • Loading branch information
roncli committed Sep 19, 2021
1 parent 14fed87 commit 7062701
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion XIVAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See how in https://github.com/xivapi/xivapi-js/releases/tag/v0.1.3.\n\

this.endpoint = `https://${options.staging ? 'staging.' : ''}xivapi.com`
if(options.language && !resources.languages.includes(options.language))
throw Error(`Invalid language given, must be one of: ${this.resources.languages}`)
throw Error(`Invalid language given, must be one of: ${resources.languages}`)

this.globalParams = {}

Expand Down

0 comments on commit 7062701

Please sign in to comment.