From 76dfbba88b4945f40c3035a88788591528bc09cb Mon Sep 17 00:00:00 2001 From: hknokh2 Date: Sun, 25 Jun 2023 18:49:47 +0300 Subject: [PATCH] fix: Fixed custom Add-On module loading issue #600 --- messages/resources.json | 2 +- src/addons/components/sfdmu-run/sfdmuRunAddonManager.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/messages/resources.json b/messages/resources.json index 036954e9..97bb8c24 100644 --- a/messages/resources.json +++ b/messages/resources.json @@ -22,7 +22,7 @@ "customAddon": "Custom Add-On", "cantLoad": "%s is not found or could not be loaded.", "global": "Global", - "cantLoadModule": "Can not load module %s.", + "cantLoadModule": "Cannot load module '%s'. Please ensure that the module exists in the desired location, it is properly configured, and it has an 'onExecute' entry point function.", "actionNotPermitted": "The action is not permitted.", "defaultPromptOptions": "y/n", diff --git a/src/addons/components/sfdmu-run/sfdmuRunAddonManager.ts b/src/addons/components/sfdmu-run/sfdmuRunAddonManager.ts index d5f6f88f..f7026209 100644 --- a/src/addons/components/sfdmu-run/sfdmuRunAddonManager.ts +++ b/src/addons/components/sfdmu-run/sfdmuRunAddonManager.ts @@ -249,7 +249,7 @@ export default class SfdmuRunAddonManager { this.addonsMap.get(addon.event).push([ moduleInstance.onExecute.bind(moduleInstance, moduleInstance.context, addon.args), addon, - moduleInstance.onInit.bind(moduleInstance, moduleInstance.context, addon.args), + moduleInstance.onInit ? moduleInstance.onInit.bind(moduleInstance, moduleInstance.context, addon.args) : () => void 0, ]); } } catch (ex) {