diff --git a/src/views/system/deviceManage/editConfig.vue b/src/views/system/deviceManage/editConfig.vue index bd2909cc2..f3c7eced5 100644 --- a/src/views/system/deviceManage/editConfig.vue +++ b/src/views/system/deviceManage/editConfig.vue @@ -127,10 +127,12 @@ export default { } }); let flag = false; - for (var i = 0; i < value.length; i++) { - const ascallCode = value.charCodeAt(i); - if (ascallCode > 70 || ascallCode < 48 || (ascallCode > 57 && ascallCode < 65)) { - flag = true; + if (value && value.length) { + for (var i = 0; i < value.length; i++) { + const ascallCode = value.charCodeAt(i); + if (ascallCode > 70 || ascallCode < 48 || (ascallCode > 57 && ascallCode < 65)) { + flag = true; + } } } if (!value) {