[backend/razor] Don't render attachment count for link previews when there are no attachments

This commit is contained in:
Laura Hausmann 2024-07-27 17:31:33 +02:00
parent 828b742a3f
commit 72c0db55e3
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -101,7 +101,7 @@ else
else
{
var text = Model.Note.Text;
if (attachments != null)
if (attachments is { Count: > 0 })
{
var attachmentText = $"({attachments.Count} attachments)";
if (string.IsNullOrWhiteSpace(text))