From 8f3e722d54dac156fd3d272acba09e32163883df Mon Sep 17 00:00:00 2001 From: liaoxuezhi <2698393+2betop@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:38:41 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=20invalid=20label?= =?UTF-8?q?=20=E5=B1=95=E7=A4=BA,=20=E6=97=A0=E6=95=B0=E6=8D=AE=E6=98=AF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=20-=20(#11308)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-core/src/utils/labelToString.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/amis-core/src/utils/labelToString.ts b/packages/amis-core/src/utils/labelToString.ts index 40061b7b2b8..f9442a18c35 100644 --- a/packages/amis-core/src/utils/labelToString.ts +++ b/packages/amis-core/src/utils/labelToString.ts @@ -2,6 +2,10 @@ import isPlainObject from 'lodash/isPlainObject'; export function labelToString(label: any): string { const type = typeof label; + if (type === 'undefined' || label === null) { + // render placeholder + return '-'; + } if (type === 'string') { return label; } else if (type === 'number') {