fix(electron-utils): validate fallback save dir instead of crashing later (#313)

This commit is contained in:
ANIRUDDHA ADAK
2026-09-12 11:38:56 +08:00
committed by GitHub
parent e6d5815d25
commit 474c8fcdc7
2 changed files with 7 additions and 1 deletions
@@ -69,6 +69,12 @@ describe('resolveDefaultSaveDir', () => {
chmodSync(readOnly, 0o700)
}
})
it('throws a descriptive error when the fallback itself is unusable', () => {
const blocker = join(root, 'blocker')
writeFileSync(blocker, 'x')
expect(() => resolveDefaultSaveDir(null, blocker)).toThrow(/default save dir not usable/)
})
})
describe('configuredDefaultSaveDir', () => {