Skip to content

Commit

Permalink
Generalize verify integers check
Browse files Browse the repository at this point in the history
Fixes #1416
  • Loading branch information
Tyriar committed Oct 7, 2019
1 parent e14b1f7 commit 724bcc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/public/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ export class Terminal implements ITerminalApi {

private _verifyIntegers(...values: number[]): void {
values.forEach(value => {
if (value % 1 !== 0) {
throw new Error('This API does not accept floating point numbers');
if (value === Infinity || value === NaN || value % 1 !== 0) {
throw new Error('This API only accepts integers');
}
});
}
Expand Down

0 comments on commit 724bcc3

Please sign in to comment.