mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
fix: crash in mocks.profile
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user