extensions: Consistently handle createExtensionObject() errors
The method may throw an error, for example when metadata.json is missing or cannot be parsed, however we are currently not always handling it. https://bugzilla.gnome.org/show_bug.cgi?id=781728
This commit is contained in:
@ -199,7 +199,14 @@ function reloadExtension(oldExtension) {
|
||||
unloadExtension(oldExtension);
|
||||
|
||||
// Now, recreate the extension and load it.
|
||||
let newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
|
||||
let newExtension;
|
||||
try {
|
||||
newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
|
||||
} catch(e) {
|
||||
logExtensionError(uuid, e);
|
||||
return;
|
||||
}
|
||||
|
||||
loadExtension(newExtension);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user