Fix #2285 - handle scenario where the module definition associated to a module instance does not exist

This commit is contained in:
Shaun Walker
2022-07-14 16:58:16 -04:00
parent d6258409fc
commit 310d1ed485
4 changed files with 35 additions and 25 deletions

View File

@ -11,8 +11,7 @@
Module module = await ModuleService.GetModuleAsync(ModuleState.ModuleId);
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
string message = string.Format(Localizer["Error.Module.Load"], module.ModuleDefinitionName);
AddModuleMessage(message, MessageType.Error);
AddModuleMessage(string.Format(Localizer["Error.Module.Load"], module.ModuleDefinitionName), MessageType.Error);
}
await logger.LogCritical("Error Loading Module {Module}", module);