Skip to content

Commit

Permalink
Merge pull request #393 from buttercup/procedure-fix
Browse files Browse the repository at this point in the history
Silently fail when procedure is not available
  • Loading branch information
sallar authored Nov 10, 2017
2 parents ef4474e + 899f899 commit de59eef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/lib/window-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ class WindowManager {
* @returns {BrowserWindow}
*/
buildWindowOfType(type, fn = null, options = {}) {
const window = this._buildProcedures[type](fn, options);
this.register(type, window);
return window;
const procedure = this._buildProcedures[type];
if (typeof procedure !== 'function') {
return;
}
const win = procedure(fn, options);
this.register(type, win);
return win;
}

/**
Expand Down

0 comments on commit de59eef

Please sign in to comment.