Преглед на файлове

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

Joel преди 3 месеца
родител
ревизия
f565f08aa0
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      web/app/components/workflow/nodes/_base/components/variable/utils.ts

+ 3 - 1
web/app/components/workflow/nodes/_base/components/variable/utils.ts

@@ -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
       }