Skip to content

Commit 0c1c0a6

Browse files
authored
[elsa] 修复条件节点运行结果空指针问题 (#25)
1 parent 6f2fb86 commit 0c1c0a6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

framework/elsa/fit-elsa-react/src/components/flowRunComponent/SectionFactory.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
* Licensed under the MIT License. See License.txt in the project root for license information.
55
*--------------------------------------------------------------------------------------------*/
66

7-
import SectionHeader from "@/components/flowRunComponent/SectionHeader.jsx";
8-
import SectionContent from "@/components/flowRunComponent/SectionContent.jsx";
9-
import {v4 as uuidv4} from "uuid";
10-
import {Card} from "antd";
7+
import SectionHeader from '@/components/flowRunComponent/SectionHeader.jsx';
8+
import SectionContent from '@/components/flowRunComponent/SectionContent.jsx';
9+
import {v4 as uuidv4} from 'uuid';
10+
import {Card} from 'antd';
1111
import {DATA_TYPES, SECTION_TYPE, UNARY_OPERATOR, VIRTUAL_CONTEXT_NODE} from '@/common/Consts.js';
12-
import {useTranslation} from "react-i18next";
12+
import {useTranslation} from 'react-i18next';
1313

1414
/**
1515
* 构造运行报告的章节
@@ -87,7 +87,7 @@ export default function SectionFactory({shape}) {
8787
const rightValue = _convertRightValue(condition);
8888
const separatorIndex = key.indexOf(".");
8989
const referenceNodeId = key.substring(0, separatorIndex);
90-
const text = referenceNodeId === VIRTUAL_CONTEXT_NODE.id ? t('systemEnv') : shape.page.getShapeById(referenceNodeId).text;
90+
const text = referenceNodeId === VIRTUAL_CONTEXT_NODE.id ? t('systemEnv') : shape.page.getShapeById(referenceNodeId)?.text ?? '';
9191
const newKey = text + key.substring(separatorIndex);
9292
let isShowLogic = section.data.conditions.length > 1 && index < section.data.conditions.length - 1;
9393
return (<div key={`condition-container-${section.no}-${uuidv4()}`}

0 commit comments

Comments
 (0)