author | Harry Twyford <harry.a.twyford@gmail.com> |
Sun, 27 Jan 2019 22:06:38 +0000 | |
changeset 455573 | 747303cab27a597bbfdffd2c1db157f5d65c4f0f |
parent 455572 | 06e3993985b77e62c9b6ee1f9dba87da407eb6d1 |
child 455574 | 3c9634352cd66e1debc3beeedd53130d16474db2 |
push id | 35448 |
push user | btara@mozilla.com |
push date | Mon, 28 Jan 2019 04:51:03 +0000 |
treeherder | mozilla-central@d2516083582b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mikedeboer |
bugs | 1522994 |
milestone | 66.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/components/touchbar/MacTouchBar.js +++ b/browser/components/touchbar/MacTouchBar.js @@ -227,26 +227,31 @@ class TouchBarHelper { // Remove unimplemented/mispelled inputs. prefArray = prefArray.filter(input => Object.keys(kBuiltInInputs).includes(input)); this._storedLayout = prefArray; return this._storedLayout; } getTouchBarInput(inputName) { + // inputName might be undefined if an input's context() returns undefined. + if (!inputName || !kBuiltInInputs.hasOwnProperty(inputName)) { + return null; + } + if (typeof kBuiltInInputs[inputName].context == "function") { inputName = kBuiltInInputs[inputName].context(); } - let inputData = kBuiltInInputs[inputName]; - - if (!inputData) { + if (!inputName || !kBuiltInInputs.hasOwnProperty(inputName)) { return null; } + let inputData = kBuiltInInputs[inputName]; + let item = new TouchBarInput(inputData); // Async l10n fills in the localized input labels after the initial load. this._l10n.formatValue(item.key).then((result) => { item.title = result; kBuiltInInputs[inputName].localTitle = result; // Cache result. // Checking this.window since this callback can fire after all windows are closed. if (this.window) {