Skip to content

Commit 9e5abc9

Browse files
committed
fix: guard RendererPaths for settings window (no userDataPath)
Settings window opens without ?udp= parameter, so RendererPaths constructor threw on null path. Wrap in try/catch — paths stays null when unavailable, which is fine for the settings page.
1 parent 4c9c586 commit 9e5abc9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/renderer/src/bootstrap.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ const bootstrapRenderer = () => {
9595
window.addEventListener('unhandledrejection', handleRendererError)
9696

9797
const { debug, initialState, userDataPath, windowId, type } = parseUrlArgs()
98-
const paths = new RendererPaths(userDataPath)
98+
let paths = null
99+
try {
100+
paths = new RendererPaths(userDataPath)
101+
} catch {
102+
// Settings window doesn't pass userDataPath — paths stays null
103+
}
99104
const marktext = {
100105
initialState,
101106
env: {

0 commit comments

Comments
 (0)