Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null operator in ModuleState.ModuleDefinition #4601

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

hishamco
Copy link
Contributor

No description provided.

@sbwalker
Copy link
Member

@hishamco this is a valid issue. I am guessing you were able to trigger this issue is by deleting a module assembly from the /bin for a module which is already in use within a site - which essentially creates an "orphaned module" scenario (hence the ModuleDefinition property is null).

In regards to fixing the problem, my preference would be to move the _module assignment to within the condition if block where all of other assignments which depend on ModuleDefinition are already located. It makes the logic clearer.

if (ModuleState.ModuleDefinition != null)
{
>>   _module = ModuleState.ModuleDefinition.Name; <<
   _permissionNames = ModuleState.ModuleDefinition?.PermissionNames;

if you make this change I will merge this PR.

@sbwalker sbwalker merged commit 0f2b553 into oqtane:dev Sep 13, 2024
1 check passed
@hishamco hishamco deleted the module-settings branch September 13, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants