custom-module: fix receive shorthand function when omitting host/port and sending 0 or 1 arg

This commit is contained in:
jean-emmanuel 2019-04-10 23:38:31 +02:00
parent 333ce12806
commit ac7c5b3df7
2 changed files with 4 additions and 3 deletions

View file

@ -3,7 +3,8 @@
## 0.45.3
- bug fixes
- broken client sync for widgets with `split` set
- broken client sync for widgets with `split` set
- custom module: `receive` function not working when omitting host/port and sending only one argument
## 0.45.2

View file

@ -50,8 +50,8 @@ class OscServer {
receive: (host, port, address, ...args)=>{
if (host[0] === '/') {
// host and port can be skipped
args.unshift(address)
args.unshift(port)
if (address !== undefined) args.unshift(address)
if (port !== undefined) args.unshift(port)
address = host
host = port = undefined
}