解决在组件不输入内容的情况下,LEN函数返回9的错误(undefined字符串的长度)

This commit is contained in:
kzl 2024-11-21 07:57:39 +08:00
parent 8c046312c0
commit c3b0e979b2

View File

@ -1110,6 +1110,9 @@ export class Evaluator {
* @returns {number} * @returns {number}
*/ */
fnLEN(text: string) { fnLEN(text: string) {
if (text === undefined || text === null) {
return 0;
}
text = this.normalizeText(text); text = this.normalizeText(text);
return text?.length; return text?.length;
} }