From 1b1cf3a444aca8040e228d6b69ff39082a45312c Mon Sep 17 00:00:00 2001 From: Taoning Ge Date: Fri, 11 Sep 2026 20:54:01 +0800 Subject: [PATCH] ui: problemconfig: guard empty config load for js-yaml v5 js-yaml v5 throws on empty input where v4 returned undefined, so a problem without config.yaml landed in the error branch (__valid=false): config page forced to the Errors tab, subtask auto-inference invisible, and the editor never synced. Default to '{}' like the server-side fix (87f64d60) so empty configs load as an empty subtask list. --- packages/ui-default/components/problemconfig/reducer/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui-default/components/problemconfig/reducer/config.ts b/packages/ui-default/components/problemconfig/reducer/config.ts index 5a2946f40..2325b5b10 100644 --- a/packages/ui-default/components/problemconfig/reducer/config.ts +++ b/packages/ui-default/components/problemconfig/reducer/config.ts @@ -21,7 +21,7 @@ export default function reducer(state = { case 'CONFIG_LOAD_FULFILLED': { const c = { ...state, __loaded: true }; try { - let data = yaml.load(action.payload.config) as any; + let data = yaml.load(action.payload.config || '{}') as any; if (typeof data !== 'object') data = { subtasks: [] }; else data.subtasks ||= []; if (!validate(data)) {