diff --git a/src/extension-support/extension-manager.js b/src/extension-support/extension-manager.js index 93cc8957ed9..966ffa8ea19 100644 --- a/src/extension-support/extension-manager.js +++ b/src/extension-support/extension-manager.js @@ -277,7 +277,7 @@ class ExtensionManager { /** * Regenerate blockinfo for any loaded extensions - * @param {string=} optExtensionId Optional extension ID for refreshing + * @param {string} [optExtensionId] Optional extension ID for refreshing * @returns {Promise} resolved once all the extensions have been reinitialized */ refreshBlocks (optExtensionId) { @@ -289,7 +289,10 @@ class ExtensionManager { .catch(e => { log.error('Failed to refresh built-in extension primitives', e); }); - if (optExtensionId && this._loadedExtensions.has(optExtensionId)) { + if (optExtensionId) { + if (!this._loadedExtensions.has(optExtensionId)) { + throw new Error(`Unknown extension: ${optExtensionId}`); + } return refresh(this._loadedExtensions.get(optExtensionId)); } const allPromises = Array.from(this._loadedExtensions.values()).map(refresh);