ui: problemconfig: guard empty config load for js-yaml v5 (#1208)

This commit is contained in:
Taoning Ge authored and GitHub committed 2026-09-11 22:00:32 +08:00
1 parent 67b605393c
commit 6635257ad0
1 file changed
+1 -1
@@ -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)) {