props: prevent error with empty OSC{} blocks
This commit is contained in:
parent
e0cd1bf163
commit
daa9038dfe
2 changed files with 9 additions and 0 deletions
|
|
@ -623,12 +623,16 @@ class Widget extends EventEmitter {
|
|||
|
||||
propValue = balancedReplace('OSC{', '}', propValue, (args)=>{
|
||||
|
||||
if (args === '') return 'undefined'
|
||||
|
||||
let [address, value, usePreArgs] = args.split(',')
|
||||
.map(x=>x.trim())
|
||||
.map(x=>x.replace(/VAR_[0-9]+/g, (m)=>{
|
||||
return typeof variables[m] === 'string' ? variables[m] : JSON.stringify(variables[m])
|
||||
}))
|
||||
|
||||
if (!address) return 'undefined'
|
||||
|
||||
if (!this.oscReceivers[args]) {
|
||||
this.oscReceivers[args] = new OscReceiver({
|
||||
address: address,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue