Browse Source

Merge pull request #1364 from Siykt/fix/js-block

Fix: handleConditionCode add check
Ahmad Kholid 1 year ago
parent
commit
f1c27a8d4c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/sandbox/utils/handleConditionCode.js

+ 3 - 0
src/sandbox/utils/handleConditionCode.js

@@ -5,6 +5,9 @@ export default function (data) {
   script.textContent = `
     (async () => {
       function automaRefData(keyword, path = '') {
+        if (!keyword) return null;
+        if (!path) return ${propertyName}.refData[keyword];
+
         return window.$getNestedProperties(${propertyName}.refData, keyword + '.' + path);
       }