Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Fix "about" dialog crashing the app when called from the main process
Browse files Browse the repository at this point in the history
Because dialog.showMessageBox throws an error when passing undefined as its first argument.
  • Loading branch information
brrd committed Apr 15, 2016
1 parent 8d41c50 commit 6ee2fcb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions app/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ var appDialogs = {

about: function (win) {
win = getWindow(win);
var image = NativeImage.createFromPath(constants.path.icon);
dialog.showMessageBox(win, {
title: "About",
message: "ABRICOTINE - MARKDOWN EDITOR (v. " + constants.appVersion + ")\n\nCopyright (c) 2015 Thomas Brouard\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.",
buttons: ['OK'],
icon: image
});
var image = NativeImage.createFromPath(constants.path.icon),
options = {
title: "About",
message: "ABRICOTINE - MARKDOWN EDITOR (v. " + constants.appVersion + ")\n\nCopyright (c) 2015 Thomas Brouard\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.",
buttons: ['OK'],
icon: image
};
if (win) {
dialog.showMessageBox(win, options);
} else {
dialog.showMessageBox(options);
}
},

askClose : function (abrDoc, closeFunc, win) {
Expand Down

0 comments on commit 6ee2fcb

Please # to comment.