Skip to content

Commit

Permalink
Check correctly for undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Dzialocha committed Nov 5, 2017
1 parent fa87750 commit 87ff317
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/message.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { isString, isArray, isInt, isFloat, isBlob } from './common/utils'
import {
isArray,
isBlob,
isFloat,
isInt,
isString,
isUndefined,
} from './common/utils'

import Helper, { typeTag, prepareAddress } from './common/helpers'

import AtomicInt32 from './atomic/int32'
Expand Down Expand Up @@ -51,7 +59,7 @@ export default class Message {
* @param {*} item
*/
add(item) {
if (!item) {
if (isUndefined(item)) {
throw new Error('OSC Message needs a valid OSC Atomic Data Type')
}

Expand Down

0 comments on commit 87ff317

Please sign in to comment.