Skip to content

Commit

Permalink
fix: while validating for offset, check for offset's value for NaN in…
Browse files Browse the repository at this point in the history
…stead length (#2124)
  • Loading branch information
mbauskar authored Aug 11, 2020
1 parent 19fb5f8 commit 4215122
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/binding-abstract/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ The in progress reads must error when the port is closed with an error object th
throw new TypeError('"buffer" is not a Buffer')
}

if (typeof offset !== 'number' || isNaN(length)) {
throw new TypeError(`"offset" is not an integer got "${isNaN(length) ? 'NaN' : typeof offset}"`)
if (typeof offset !== 'number' || isNaN(offset)) {
throw new TypeError(`"offset" is not an integer got "${isNaN(offset) ? 'NaN' : typeof offset}"`)
}

if (typeof length !== 'number' || isNaN(length)) {
Expand Down

0 comments on commit 4215122

Please sign in to comment.