diff --git a/lib/Grunt.js b/lib/Grunt.js index 24a893b..63d51c1 100644 --- a/lib/Grunt.js +++ b/lib/Grunt.js @@ -8,7 +8,11 @@ global.processes = {} exports.getTasks = function () { return new Promise(function (resolve, reject) { - fs.readFile(path.join(window.localStorage.getItem('current'), 'Gruntfile.js'), function (err, gruntfile) { + let current = window.localStorage.getItem('current') + + if (!current) return resolve([]) + + fs.readFile(path.join(current, 'Gruntfile.js'), function (err, gruntfile) { if (err) return resolve([]) grunt.init(gruntfile) diff --git a/src/tray.js b/src/tray.js index 44c4981..e0aff0d 100644 --- a/src/tray.js +++ b/src/tray.js @@ -17,7 +17,7 @@ void (function () { function build () { trayMenu.append(new MenuItem({ - label: window.localStorage.getItem('current'), + label: window.localStorage.getItem('current') || 'Choose folder...', click: function () { dialog.showOpenDialog({ properties: ['openDirectory']}, function (dir) { if (dir !== undefined) {