MWSaveDialogAction: Don't break on strange accesskey messages

Quietly return instead.

Bug: T153472
Change-Id: I7c325624734f122c9fd939aee1192187c63d9247
This commit is contained in:
Alex Monk 2016-12-17 01:58:37 +00:00 committed by James D. Forrester
parent f182d5d223
commit 17ced451f4

View file

@ -147,9 +147,14 @@ ve.ui.commandRegistry.register(
shortcuts.forEach( function ( shortcut ) {
var accessKey = ve.msg( shortcut.accessKey );
if ( accessKey !== '-' && accessKey !== '' ) {
ve.ui.triggerRegistry.register(
shortcut.command, new ve.ui.Trigger( accessKeyPrefix + accessKey )
);
try {
ve.ui.triggerRegistry.register(
shortcut.command, new ve.ui.Trigger( accessKeyPrefix + accessKey )
);
} catch ( e ) {
mw.log.warn( 'Invalid accesskey data? Failed to register ' + accessKeyPrefix + accessKey );
return;
}
ve.ui.commandHelpRegistry.register( 'other', shortcut.command, {
trigger: shortcut.command,
label: shortcut.label
@ -157,5 +162,4 @@ ve.ui.commandRegistry.register(
ve.ui.MWCommandHelpDialog.static.commandGroups.other.demote.push( shortcut.command );
}
} );
}() );