Skip to content

Commit

Permalink
fix: check if stream can be read (better)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpop-zengenti committed Oct 15, 2024
1 parent 3973479 commit 15ab54b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public async Task<EndpointResponse> Invoke(
else
{
var endpointResponseStream = endpointResponse.ToStream(true);
if (endpointResponseStream is MemoryStream stream and { CanSeek: true, Length: > 0 } and)
if (endpointResponseStream is MemoryStream { CanSeek: true, Length: > 0 } stream)
{
using var reader = new StreamReader(stream, leaveOpen: true);
responseContent = await reader.ReadToEndAsync(cancellationToken);
Expand Down

0 comments on commit 15ab54b

Please sign in to comment.