mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4465 from node-red/4464-fix-switch-typeof-validation
Fix switch validation of typeof field
This commit is contained in:
commit
b06494c5be
@ -176,14 +176,16 @@
|
|||||||
for (var i=0;i<rules.length;i++) {
|
for (var i=0;i<rules.length;i++) {
|
||||||
const opt = { label: RED._('node-red:switch.label.rule')+' '+(i+1) }
|
const opt = { label: RED._('node-red:switch.label.rule')+' '+(i+1) }
|
||||||
const r = rules[i];
|
const r = rules[i];
|
||||||
if (r.hasOwnProperty('v')) {
|
if (r.t !== 'istype') {
|
||||||
if ((msg = RED.utils.validateTypedProperty(r.v,r.vt,opt)) !== true) {
|
if (r.hasOwnProperty('v')) {
|
||||||
errors.push(msg)
|
if ((msg = RED.utils.validateTypedProperty(r.v,r.vt,opt)) !== true) {
|
||||||
|
errors.push(msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (r.hasOwnProperty('v2')) {
|
||||||
if (r.hasOwnProperty('v2')) {
|
if ((msg = RED.utils.validateTypedProperty(r.v2,r.v2t,opt)) !== true) {
|
||||||
if ((msg = RED.utils.validateTypedProperty(r.v2,r.v2t,opt)) !== true) {
|
errors.push(msg)
|
||||||
errors.push(msg)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user