From d461d02cdcc007138f9d39dc7ca7cd62a38e3607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 May 2017 23:57:18 +0200 Subject: [PATCH] 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 --- js/ui/extensionSystem.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index fc359e6ac..f25d63ae8 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -225,7 +225,12 @@ function initExtension(uuid) { let extensionState = null; ExtensionUtils.installImporter(extension); - extensionModule = extension.imports.extension; + try { + extensionModule = extension.imports.extension; + } catch(e) { + logExtensionError(uuid, e); + return false; + } if (extensionModule.init) { try {