소스 검색

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

Fix: handleConditionCode add check
Ahmad Kholid 1 년 전
부모
커밋
f1c27a8d4c
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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);
       }