Browse Source

fix: match is not a function

Ahmad Kholid 2 years ago
parent
commit
d4b1171e08
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/components/newtab/workflow/editor/EditorUsedCredentials.vue

+ 2 - 2
src/components/newtab/workflow/editor/EditorUsedCredentials.vue

@@ -71,12 +71,12 @@ function checkCredentials() {
 
   props.editor.getNodes.value.forEach(({ label, id, data }) => {
     const keys = tasks[label]?.refDataKeys;
-    if (!keys) return;
+    if (!keys || !data) return;
 
     const usedCredentials = new Set();
 
     keys.forEach((key) => {
-      const match = data[key]?.match(regex);
+      const match = data[key]?.match?.(regex);
       if (!match || !match[1]) return;
 
       usedCredentials.add(match[1]);