fix: crash in mocks.profile

This commit is contained in:
Barış Soner Uşaklı
2024-06-04 12:30:47 -04:00
parent 76290e3789
commit 6f37825b1a

View File

@@ -41,7 +41,14 @@ Mocks.profile = async (actors) => {
postcount, inbox, endpoints,
} = actor;
preferredUsername = preferredUsername || slugify(name);
const { hostname } = new URL(actor.id);
let hostname;
try {
({ hostname } = new URL(actor.id));
} catch (err) {
console.error(err.stack);
return null;
}
let picture;
if (icon) {