diff --git a/scripts/install-dirigent-openclaw.mjs b/scripts/install-dirigent-openclaw.mjs index 9375e5a..25fade3 100755 --- a/scripts/install-dirigent-openclaw.mjs +++ b/scripts/install-dirigent-openclaw.mjs @@ -67,8 +67,12 @@ function runOpenclaw(args, { allowFail = false } = {}) { function getJson(pathKey) { const out = runOpenclaw(["config", "get", pathKey, "--json"], { allowFail: true }); - if (out == null || out === "") return undefined; - return JSON.parse(out); + if (out == null || out === "" || out === "undefined") return undefined; + try { + return JSON.parse(out); + } catch { + return undefined; + } } function setJson(pathKey, value) {