fix: get property of string type variable caused page crash (#12969)

This commit is contained in:
Joel 2025-01-23 11:02:29 +08:00 committed by GitHub
parent fd4afe09f8
commit f565f08aa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -546,7 +546,9 @@ export const getVarType = ({
else {
(valueSelector as ValueSelector).slice(1).forEach((key, i) => {
const isLast = i === valueSelector.length - 2
curr = curr?.find((v: any) => v.variable === key)
if (Array.isArray(curr))
curr = curr?.find((v: any) => v.variable === key)
if (isLast) {
type = curr?.type
}