Bug 282097 - Part 10: Ensure input commands are enabled. r=enndeakin

This commit is contained in:
J. Ryan Stinnett 2013-07-10 09:14:21 -05:00
parent 8dd81455a4
commit ce023dcc05

View File

@ -794,7 +794,14 @@ DoCommandCallback(const char *aCommand, void *aData)
nsCOMPtr<nsIController> controller;
controllers->GetControllerForCommand(aCommand, getter_AddRefs(controller));
if (controller) {
if (!controller) {
return;
}
bool commandEnabled;
nsresult rv = controller->IsCommandEnabled(aCommand, &commandEnabled);
NS_ENSURE_SUCCESS_VOID(rv);
if (commandEnabled) {
controller->DoCommand(aCommand);
}
}