From c1907be3d2e796f1065aa7014422dc5f11ede0ac Mon Sep 17 00:00:00 2001 From: Jeff Morgan Date: Tue, 9 Sep 2014 17:03:02 -0700 Subject: [PATCH] Fixing mainWindow undefined error --- index.js | 6 +++++- script/dist.sh | 1 - script/setup.sh | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 923ab6f841..b030f32b39 100644 --- a/index.js +++ b/index.js @@ -96,8 +96,12 @@ var start = function (callback) { } }; +mainWindow = null; + app.on('activate-with-no-open-windows', function () { - mainWindow.show(); + if (!mainWindow) { + mainWindow.show(); + } return false; }); diff --git a/script/dist.sh b/script/dist.sh index 816fa67fe9..28a0b33213 100755 --- a/script/dist.sh +++ b/script/dist.sh @@ -3,7 +3,6 @@ set -e # Auto exit on error DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/colors.sh -source $DIR/versions.sh BASE=$DIR/.. NPM="$BASE/cache/node/bin/npm" diff --git a/script/setup.sh b/script/setup.sh index 1fa6db3be1..eb4b13daf8 100755 --- a/script/setup.sh +++ b/script/setup.sh @@ -3,7 +3,6 @@ set -e # Auto exit on error DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/colors.sh -source $DIR/versions.sh BASE=$DIR/.. pushd $BASE