исправление ошибки с пустыми output блоками при экспорте

This commit is contained in:
Эллина Сохненко 2026-06-04 09:06:17 +03:00
parent 79f67accb0
commit 985bb8827e

View File

@ -489,7 +489,7 @@ function App() {
nodes.forEach(node => {
const newInd = nodesIndexes.get(node.id)
if (node && node.data.type === 'input' || node.data.type === 'const') {
for (let i = 0; i < newInd.length; i++) {
for (let i = 0; i < newInd?.length; i++) {
xml += ` <inVariable localId="${newInd[i]}" width="${node.data.width}" height="${node.data.height}">\n`
xml += ` <position x="${Math.round(node.position.x)}" y="${Math.round(node.position.y)}"/>\n`
xml += ` <connectionPointOut/>\n`
@ -502,7 +502,7 @@ function App() {
nodes.forEach(node => {
const newInd = nodesIndexes.get(node.id)
if (node.data.type === 'output') {
for (let i = 0; i < newInd.length; i++) {
for (let i = 0; i < newInd?.length; i++) {
xml += ` <outVariable localId="${newInd[i]}" width="${node.data.width}" height="${node.data.height}">\n`
xml += ` <position x="${Math.round(node.position.x)}" y="${Math.round(node.position.y)}"/>\n`
xml += ` <connectionPointIn>\n`