fix(editor): Fix failing non-null assertion in useDataSchema:getNodeInputData (no-changelog) (#11807)

This commit is contained in:
Charlie Kolb
2024-11-20 15:30:12 +01:00
committed by GitHub
parent bcb9a20781
commit 187edf28aa
2 changed files with 131 additions and 5 deletions

View File

@@ -72,12 +72,13 @@ export function useDataSchema() {
if (
!connectionsData?.hasOwnProperty(NodeConnectionType.Main) ||
connectionsData.main === undefined ||
connectionsData.main.length < outputIndex ||
outputIndex < 0 ||
outputIndex >= connectionsData.main.length ||
connectionsData.main[outputIndex] === null
) {
return [];
}
return connectionsData.main[outputIndex] as INodeExecutionData[];
return connectionsData.main[outputIndex];
}
function getNodeInputData(
@@ -100,11 +101,12 @@ export function useDataSchema() {
}
const runData = executionData.resultData.runData;
if (!runData?.[node.name]?.[runIndex].data || runData[node.name][runIndex].data === undefined) {
const taskData = runData?.[node.name]?.[runIndex];
if (taskData?.data === undefined) {
return [];
}
return getMainInputData(runData[node.name][runIndex].data!, outputIndex);
return getMainInputData(taskData.data, outputIndex);
}
function getInputDataWithPinned(