Bug 1272133 - Fix runtime error thrown when no shortcut is found for the target platform. r=kmag

MozReview-Commit-ID: CzR64GL5mxn
This commit is contained in:
Matthew Wein
2016-07-25 11:18:12 -07:00
parent e3d00b8074
commit 45f6930e3f

View File

@@ -77,10 +77,12 @@ CommandList.prototype = {
for (let name of Object.keys(manifest.commands)) {
let command = manifest.commands[name];
let shortcut = command.suggested_key[os] || command.suggested_key.default;
commands.set(name, {
description: command.description,
shortcut: shortcut.replace(/\s+/g, ""),
});
if (shortcut) {
commands.set(name, {
description: command.description,
shortcut: shortcut.replace(/\s+/g, ""),
});
}
}
return commands;
},