diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 5f3a99d47..524b54ead 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -107,7 +107,6 @@ export default function GenericNode({ setValidationStatus(null); } }, [sseData, data.id]); - return ( <> diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index a9b157c66..4b431cb22 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -311,15 +311,20 @@ export function getConnectedNodes( return nodes.filter((node) => node.id === targetId || node.id === sourceId); } -export function convertObjToArray(singleObject) { +export function convertObjToArray(singleObject: object | string) { + if (typeof singleObject === "string") { + singleObject = JSON.parse(singleObject); + } if (Array.isArray(singleObject)) return singleObject; - let arrConverted: any = []; - for (const key in singleObject) { - if (singleObject.hasOwnProperty(key)) { - const newObj = {}; - newObj[key] = singleObject[key]; - arrConverted.push(newObj); + let arrConverted: any[] = []; + if (typeof singleObject === "object") { + for (const key in singleObject) { + if (Object.prototype.hasOwnProperty.call(singleObject, key)) { + const newObj = {}; + newObj[key] = singleObject[key]; + arrConverted.push(newObj); + } } } return arrConverted;