Skip to content

Commit

Permalink
added null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pksorensen committed Aug 28, 2024
1 parent 609c2c3 commit 9b4166d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Plugins/EntityPlugin1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ public class DynamicEntityPlugin<TContext> : EntityPlugin<TContext>
public override ValueTask<bool> ShouldPluginBeExecued<T>(T context, TrackedPipelineItem entity)

{
if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
if (entity.Entity is null)
{
throw new ArgumentNullException("Entry");
}
if (entity.Entity.Entity is null)
{
throw new ArgumentNullException("Entity");
}

var type = GetPluginType(context as TContext);
return ValueTask.FromResult(type.IsAssignableFrom(entity.Entity.Entity.GetType()));

Expand Down

0 comments on commit 9b4166d

Please sign in to comment.