Skip to content

Commit

Permalink
Fixed one crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Ipmake committed Apr 18, 2023
1 parent cdb6ff3 commit 9548979
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "knockoutcitylauncher",
"description": "Unofficial Knockout City Launcher",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"homepage": "./",
"main": "public/electron.js",
Expand Down
2 changes: 2 additions & 0 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function createWindow () {
// send it back to the renderer
// win.webContents.send('selected-dirs', result.filePaths[0].replaceAll("\\", "/"))
event.returnValue = result
} else {
event.returnValue = null
}
})

Expand Down
2 changes: 1 addition & 1 deletion public/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ window.addEventListener("DOMContentLoaded", () => {

window.selectGameDir = async () => {
const result = await ipcRenderer.sendSync('select-dirs')
if (!result.canceled) {
if (!result) {
return Promise.resolve(result.filePaths[0].replaceAll("\\", "/"))
}
}
Expand Down

0 comments on commit 9548979

Please sign in to comment.