rem: if (!windowCommandManager) return; 
add: if (!windowControllers) return; 
context: function SetupComposerWindowCommands(){  // Create a command controller and register commands  //   specific to Web Composer window (file-related commands, HTML Source...)  // IMPORTANT: For each of these commands, the doCommand method   //            must first call FinishHTMLSource()   //            to go from HTML Source mode to any other edit mode  var windowCommandManager = window.controllers;  if (!windowCommandManager) return;  var composerController = Components.classes["@mozilla.org/editor/composercontroller;1"].createInstance();  if (!composerController)  {    dump("Failed to create composerController\n");    return;  }  var editorController;  try {    editorController = composerController.QueryInterface(Components.interfaces.nsIEditorController);  }  catch (e) {    dump("Failed to get interface for nsIEditorController\n");    return;  }  editorController.Init(gEditor); // gEditor may be null at this point  var interfaceRequestor;  try {    interfaceRequestor = composerController.QueryInterface(Components.interfaces.nsIInterfaceRequestor);  }  catch (e) {    dump("Failed to get iterfaceRequestor for composerController\n");    return;  }      // Get the nsIControllerCommandManager interface we need to register more commands  var commandManager = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandManager);  if (!commandManager)  {    dump("Failed to get interface for nsIControllerCommandManager\n");    return;  }  // File-related commands  commandManager.registerCommand("cmd_open",           nsOpenCommand);  commandManager.registerCommand("cmd_save",           nsSaveCommand);  commandManager.registerCommand("cmd_saveAs",         nsSaveAsCommand);  commandManager.registerCommand("cmd_exportToText",   nsExportToTextCommand);  commandManager.registerCommand("cmd_saveAsCharset",  nsSaveAsCharsetCommand);  commandManager.registerCommand("cmd_publish",        nsPublishCommand);  commandManager.registerCommand("cmd_publishAs",      nsPublishAsCommand);  commandManager.registerCommand("cmd_publishSettings",nsPublishSettingsCommand);  commandManager.registerCommand("cmd_revert",         nsRevertCommand);  commandManager.registerCommand("cmd_openRemote",     nsOpenRemoteCommand);  commandManager.registerCommand("cmd_preview",        nsPreviewCommand);  commandManager.registerCommand("cmd_editSendPage",   nsSendPageCommand);  commandManager.registerCommand("cmd_print",          nsPrintCommand);  commandManager.registerCommand("cmd_printSetup",     nsPrintSetupCommand);  commandManager.registerCommand("cmd_quit",           nsQuitCommand);  commandManager.registerCommand("cmd_close",          nsCloseCommand);  commandManager.registerCommand("cmd_preferences",    nsPreferencesCommand);  // Edit Mode commands  if (window.editorShell.editorType == "html")  {    commandManager.registerCommand("cmd_NormalMode",         nsNormalModeCommand);    commandManager.registerCommand("cmd_AllTagsMode",        nsAllTagsModeCommand);    commandManager.registerCommand("cmd_HTMLSourceMode",     nsHTMLSourceModeCommand);    commandManager.registerCommand("cmd_PreviewMode",        nsPreviewModeCommand);    commandManager.registerCommand("cmd_FinishHTMLSource",   nsFinishHTMLSource);    commandManager.registerCommand("cmd_CancelHTMLSource",   nsCancelHTMLSource);  }  windowCommandManager.insertControllerAt(0, editorController);}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/1010f8aeed1d47f0f0a00649c46266c1855c197c/ComposerCommands.js/buggy/editor/ui/composer/content/ComposerCommands.js