Skip to content

Commit

Permalink
Adapt for null description
Browse files Browse the repository at this point in the history
  • Loading branch information
giggio committed Feb 8, 2024
1 parent d784d84 commit a9ff22f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rinhaback2401/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
}
app.MapPost("/clientes/{idCliente}/transacoes", async Task<Results<Ok<Transacoes>, NotFound, UnprocessableEntity>> (int idCliente, Transacao transacao, Db db, CancellationToken cancellationToken) =>
{
if (transacao.Descricao.Length > 10)
if (transacao.Descricao is null or "" or { Length: > 10 })
return TypedResults.UnprocessableEntity();
return await db.AddAsync(idCliente, transacao, cancellationToken) switch
{
Expand Down

0 comments on commit a9ff22f

Please sign in to comment.