[backend/core] Set note.text to null if it's whitespace on note creation & update
This commit is contained in:
parent
28fa7eb5de
commit
bcdcce80c9
1 changed files with 10 additions and 2 deletions
|
@ -123,7 +123,11 @@ public class NoteService(
|
|||
// ReSharper restore EntityFramework.UnsupportedServerSideFunctionCall
|
||||
|
||||
List<MfmNode>? nodes = null;
|
||||
if (text != null)
|
||||
if (text != null && string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
text = null;
|
||||
}
|
||||
else if (text != null)
|
||||
{
|
||||
nodes = MfmParser.Parse(text).ToList();
|
||||
nodes = mentionsResolver.ResolveMentions(nodes, user.Host, mentions, splitDomainMapping).ToList();
|
||||
|
@ -402,7 +406,11 @@ public class NoteService(
|
|||
|
||||
|
||||
List<MfmNode>? nodes = null;
|
||||
if (text != null)
|
||||
if (text != null && string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
text = null;
|
||||
}
|
||||
else if (text != null)
|
||||
{
|
||||
nodes = MfmParser.Parse(text).ToList();
|
||||
nodes = mentionsResolver.ResolveMentions(nodes, note.User.Host, mentions, splitDomainMapping).ToList();
|
||||
|
|
Loading…
Add table
Reference in a new issue