From: Haojian Wu Date: Wed, 30 Jul 2014 06:56:29 +0000 (+0800) Subject: Emit failed message when fail to register shortcut. X-Git-Tag: v0.15.2~7^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ad827eee908cd36d22c5783e058fd139cb71f81f;p=electron.git Emit failed message when fail to register shortcut. --- diff --git a/atom/browser/api/atom_api_shortcut.cc b/atom/browser/api/atom_api_shortcut.cc index d752b453..0613215e 100644 --- a/atom/browser/api/atom_api_shortcut.cc +++ b/atom/browser/api/atom_api_shortcut.cc @@ -63,8 +63,9 @@ void Shortcut::Register() { OnFailed("Shortcut is invalid."); return; } - GlobalShortcutListener::GetInstance()->RegisterAccelerator( - accelerator_, this); + if (!GlobalShortcutListener::GetInstance()->RegisterAccelerator( + accelerator_, this)) + OnFailed("Fail to register the shortcut."); } void Shortcut::Unregister() {