[backend/core] Whitespace-only content warning should be reset to null

This commit is contained in:
Laura Hausmann 2024-02-23 04:22:16 +01:00
parent 930f4d2aaa
commit 7c1de50768
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -69,6 +69,9 @@ public class NoteService(
if (attachments != null && attachments.Any(p => p.UserId != user.Id))
throw GracefulException.BadRequest("Refusing to create note with files belonging to someone else");
if (cw != null && string.IsNullOrWhiteSpace(cw))
cw = null;
var note = new Note
{
Id = IdHelpers.GenerateSlowflakeId(),