Merge pull request #4465 from node-red/4464-fix-switch-typeof-validation

Fix switch validation of typeof field
This commit is contained in:
Nick O'Leary 2023-12-06 10:09:39 +00:00 committed by GitHub
commit b06494c5be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,6 +176,7 @@
for (var i=0;i<rules.length;i++) {
const opt = { label: RED._('node-red:switch.label.rule')+' '+(i+1) }
const r = rules[i];
if (r.t !== 'istype') {
if (r.hasOwnProperty('v')) {
if ((msg = RED.utils.validateTypedProperty(r.v,r.vt,opt)) !== true) {
errors.push(msg)
@ -187,6 +188,7 @@
}
}
}
}
if (errors.length) {
console.log(errors)
return errors