diff --git a/main/osc.js b/main/osc.js index b64cd509..d8779368 100644 --- a/main/osc.js +++ b/main/osc.js @@ -21,16 +21,16 @@ module.exports = function(ipc, settings) { var numberType = precision==0?'integer':'float' - if (typeof args=='object') { + if (typeof args=='object' && args!==null) { for (i in args) { var arg = args[i] - if (typeof arg == 'number') { + if (typeof arg == 'number' && arg!==null) { message.append({type:numberType,value:arg}) - } else { + } else if (arg!==null){ message.append({type:'string',value:String(arg)}) } } - } else { + } else if (args!==null){ if (typeof args == 'number') { message.append({type:numberType,value:args}) } else { diff --git a/resources/docs/widgets/buttons.md b/resources/docs/widgets/buttons.md index 4a12d455..25f38588 100644 --- a/resources/docs/widgets/buttons.md +++ b/resources/docs/widgets/buttons.md @@ -5,15 +5,15 @@ Buttons are exactly what you think they are. ## toggle ```js type:'toggle', -on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending ) -off:0, // [string|number|false] value sent when toggle is off (false to prevent sending ) +on: 1, // [string|number|false|null] value sent when toggle is on (false to prevent sending, null to send no arg) +off:0, // [string|number|false|null] value sent when toggle is off (false to prevent sending, null to send no arg) ``` ## push ```js type:'push', -on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending ) -off:0, // [string|number|false] value sent when toggle is off (false to prevent sending ) +on: 1, // [string|number|false|null] value sent when toggle is on (false to prevent sending, null to send no arg) +off:0, // [string|number|false|null] value sent when toggle is off (false to prevent sending, null to send no arg) ``` ## switch