Don't try to register command line handler if already registered
Avoids an error when reiniting during tests
This commit is contained in:
parent
2ec6c7c72e
commit
849ffe0133
1 changed files with 14 additions and 11 deletions
|
@ -130,14 +130,17 @@ var ZoteroCommandLineHandler = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||||
Cm.registerFactory(
|
// Don't register if already registered (e.g., after a reinit() in tests)
|
||||||
ZoteroCommandLineHandler.classID,
|
if (!Cm.isCIDRegistered(ZoteroCommandLineHandler.classID)) {
|
||||||
"command-line-handler",
|
Cm.registerFactory(
|
||||||
ZoteroCommandLineHandler.contractID,
|
ZoteroCommandLineHandler.classID,
|
||||||
ZoteroCommandLineHandler
|
"command-line-handler",
|
||||||
);
|
ZoteroCommandLineHandler.contractID,
|
||||||
const catman = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
|
ZoteroCommandLineHandler
|
||||||
|
);
|
||||||
catman.addCategoryEntry("command-line-handler",
|
const catman = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
|
||||||
"m-zotero",
|
|
||||||
ZoteroCommandLineHandler.contractID, false, true);
|
catman.addCategoryEntry("command-line-handler",
|
||||||
|
"m-zotero",
|
||||||
|
ZoteroCommandLineHandler.contractID, false, true);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue