From e29e8fda8fa2e32e83acfeb4ef1613cf9d3daa21 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 9 Jan 2023 18:57:30 +0100 Subject: [PATCH] fix infering schema for inlineeditor --- frontend/src/lib/components/apps/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/apps/utils.ts b/frontend/src/lib/components/apps/utils.ts index a368b48f02..51e9ccb4aa 100644 --- a/frontend/src/lib/components/apps/utils.ts +++ b/frontend/src/lib/components/apps/utils.ts @@ -1,6 +1,7 @@ import type { Schema } from '$lib/common' import { FlowService, ScriptService } from '$lib/gen' import { inferArgs } from '$lib/infer' +import { emptySchema } from '$lib/utils' import { BarChart4, Binary, @@ -48,9 +49,11 @@ export async function loadSchema( const script = await ScriptService.getHubScriptByPath({ path }) + if (script.schema == undefined || Object.keys(script.schema).length == 0 || typeof script.schema != 'object') { + script.schema = emptySchema() + } await inferArgs(script.language, script.content, script.schema) - return script.schema } }