diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 5a9fa024..f2a95411 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -645,10 +645,6 @@ class VirtualMachine extends EventEmitter { * @param {Map} extensionURLs A map of extension ID to URL */ async _loadExtensions (extensionIDs, extensionURLs = new Map()) { - // Wait for any custom extensions that are loading to finish loading. - // We won't be able to determine which URLs we still need to load until this happens. - await this.extensionManager.allAsyncExtensionsLoaded(); - const extensionPromises = []; for (const extensionID of extensionIDs) { if (this.extensionManager.isExtensionLoaded(extensionID)) { @@ -680,7 +676,9 @@ class VirtualMachine extends EventEmitter { * @param {boolean} wholeProject - set to true if installing a whole project, as opposed to a single sprite. * @returns {Promise} resolved once targets have been installed */ - installTargets (targets, extensions, wholeProject) { + async installTargets (targets, extensions, wholeProject) { + await this.extensionManager.allAsyncExtensionsLoaded(); + targets = targets.filter(target => !!target); return this._loadExtensions(extensions.extensionIDs, extensions.extensionURLs).then(() => {