Skip to content

Commit

Permalink
add null check for settings in Serialize{T}
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualBean committed Mar 30, 2024
1 parent 0199420 commit 330afd1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/LEGO.AsyncAPI/Models/AsyncApiSerializableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public static void Serialize<T>(
throw new ArgumentNullException(nameof(stream));
}

if (settings is null)
{
throw new ArgumentNullException(nameof(settings));
}

var streamWriter = new FormattingStreamWriter(stream, settings.CultureInfo);

IAsyncApiWriter writer = format switch
Expand Down

0 comments on commit 330afd1

Please sign in to comment.