Skip to content

Commit 268018e

Browse files
committed
fix bug on windows
1 parent 5ec0e40 commit 268018e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function sendIPCToWindow (window, action, data) {
3030

3131
function createWindow (cb) {
3232
var savedBounds = fs.readFile(appDataPath + 'windowBounds.json', 'utf-8', function (e, data) {
33-
if (e) { // there was an error, probably because the file doesn't exist
33+
if (e || !data) { // there was an error, probably because the file doesn't exist
3434
var size = electron.screen.getPrimaryDisplay().workAreaSize
3535
var bounds = {
3636
x: 0,
@@ -177,7 +177,7 @@ app.on('open-url', function (e, url) {
177177
*
178178
* Opens a new tab when all tabs are closed, and min is still open by clicking on the application dock icon
179179
*/
180-
app.on('activate', function (/* e, hasVisibleWindows */) {
180+
app.on('activate', function ( /* e, hasVisibleWindows */) {
181181
if (!mainWindow && appIsReady) { // sometimes, the event will be triggered before the app is ready, and creating new windows will fail
182182
createWindow()
183183
}

0 commit comments

Comments
 (0)