Skip to content

Commit

Permalink
fix: fix syntax error when no electron config
Browse files Browse the repository at this point in the history
  • Loading branch information
subframe7536 committed Oct 19, 2024
1 parent 7f73662 commit c97ab1b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/manager/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export class MainFileManager extends BaseFileManager {
}

patch(_fontChanged: boolean, content: () => string): Promisable<string | undefined> {
return content().replace(
new RegExp(entry, 'g'),
`${JSON.stringify(config.electron).slice(1, -1)},${entry}`,
)
if (Object.keys(config.electron).length) {
return content().replace(
new RegExp(entry, 'g'),
`${JSON.stringify(config.electron).slice(1, -1)},${entry}`,
)
}
}
}

0 comments on commit c97ab1b

Please sign in to comment.