зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1522994 - Resolves crash when using Touch Bar inputs out-of-context. r=mikedeboer
Differential Revision: https://phabricator.services.mozilla.com/D17695 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5e84c40d52
Коммит
a7c263d04d
|
@ -232,16 +232,21 @@ class TouchBarHelper {
|
|||
}
|
||||
|
||||
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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче