extensionSystem: Catch import errors

While we catch errors that occur when calling init(), enable() or
disable(), the import itself can throw an exception, for instance
if the extension imports an unavailable typelib or tries to draw
in a conflicting library.

https://bugzilla.gnome.org/show_bug.cgi?id=781728
This commit is contained in:
Florian Müllner 2017-05-17 23:57:18 +02:00
parent 88b1a5d3a0
commit d461d02cdc

View File

@ -225,7 +225,12 @@ function initExtension(uuid) {
let extensionState = null;
ExtensionUtils.installImporter(extension);
try {
extensionModule = extension.imports.extension;
} catch(e) {
logExtensionError(uuid, e);
return false;
}
if (extensionModule.init) {
try {