mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 09:17:38 +00:00
fix: guard session store against array corruption
This commit is contained in:
@@ -48,7 +48,7 @@ export function readSessionStoreJson5(storePath: string): {
|
||||
try {
|
||||
const raw = fs.readFileSync(storePath, "utf-8");
|
||||
const parsed = JSON5.parse(raw);
|
||||
if (parsed && typeof parsed === "object") {
|
||||
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
||||
return { store: parsed as Record<string, SessionEntryLike>, ok: true };
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user