mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 09:33:08 +02:00
fix: normalize empty value of name
into an absent value
This commit is contained in:
parent
0e1b5d6f14
commit
194d656bb4
1 changed files with 3 additions and 0 deletions
|
@ -164,6 +164,9 @@ export class ApPersonService implements OnModuleInit {
|
||||||
throw new Error('invalid Actor: wrong name');
|
throw new Error('invalid Actor: wrong name');
|
||||||
}
|
}
|
||||||
x.name = truncate(x.name, nameLength);
|
x.name = truncate(x.name, nameLength);
|
||||||
|
} else if (x.name === '') {
|
||||||
|
// Mastodon emits empty string when the name is not set.
|
||||||
|
x.name = undefined;
|
||||||
}
|
}
|
||||||
if (x.summary) {
|
if (x.summary) {
|
||||||
if (!(typeof x.summary === 'string' && x.summary.length > 0)) {
|
if (!(typeof x.summary === 'string' && x.summary.length > 0)) {
|
||||||
|
|
Loading…
Reference in a new issue