Skip to content

Commit

Permalink
Modify the FilterModuleDefinition() method to return null if the obje…
Browse files Browse the repository at this point in the history
…ct passed to the method is null instead of returning an initialized object
  • Loading branch information
sbwalker committed May 11, 2023
1 parent 79fe224 commit f59a5c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Oqtane.Server/Repository/ModuleDefinitionRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ public void DeleteModuleDefinition(int moduleDefinitionId)

public ModuleDefinition FilterModuleDefinition(ModuleDefinition moduleDefinition)
{
var ModuleDefinition = new ModuleDefinition();
ModuleDefinition ModuleDefinition = null;

if (moduleDefinition != null)
{
// only include required client-side properties
ModuleDefinition = new ModuleDefinition();
ModuleDefinition.ModuleDefinitionId = moduleDefinition.ModuleDefinitionId;
ModuleDefinition.SiteId = moduleDefinition.SiteId;
ModuleDefinition.ModuleDefinitionName = moduleDefinition.ModuleDefinitionName;
Expand Down

0 comments on commit f59a5c9

Please sign in to comment.