Skip to content

Commit

Permalink
Update MustacheTemplateRender.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
guibranco authored Jun 27, 2024
1 parent 445d719 commit 611ef04
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,14 @@ private string RenderData(string template)
/// <exception cref="ArgumentNullException">data</exception>
public string Render(string template, object data)
{
#if NET6_0_OR_GREATER
ArgumentNullException.ThrowIfNull(data);
#else
if (data == null)

Check notice on line 289 in Src/CrispyWaffle/TemplateRendering/Engines/MustacheTemplateRender.cs

View check run for this annotation

codefactor.io / CodeFactor

Src/CrispyWaffle/TemplateRendering/Engines/MustacheTemplateRender.cs#L289

Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance. (CA1510)
{
throw new ArgumentNullException(nameof(data));
}
#endif

_properties = ParseObject(data);
return RenderData(ProcessLoop(ProcessWith(EvaluateConditional(template))));
Expand Down

0 comments on commit 611ef04

Please sign in to comment.