Skip to content

Commit ea32b61

Browse files
committed
fix: dotnet
1 parent 5fab03e commit ea32b61

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

templates/dotnet/src/Appwrite/Client.cs.twig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,13 @@ namespace {{ spec.title | caseUcfirst }}
269269
var response = await _http.SendAsync(request);
270270
var code = (int)response.StatusCode;
271271

272-
IEnumerable<string> warnings = response.Headers.TryGetValues("x-{{ spec.title | lower }}-warning");
273-
foreach (var warning in warnings)
272+
IEnumerable<string>? warnings = response.Headers.TryGetValues("x-{{ spec.title | lower }}-warning");
273+
if (warnings != null)
274274
{
275-
Console.WriteLine("Warning: " + warning);
275+
foreach (var warning in warnings)
276+
{
277+
Console.WriteLine("Warning: " + warning);
278+
}
276279
}
277280

278281
string contentType = string.Empty;

0 commit comments

Comments
 (0)