mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
fix: crash in mocks.profile
This commit is contained in:
@@ -41,7 +41,14 @@ Mocks.profile = async (actors) => {
|
|||||||
postcount, inbox, endpoints,
|
postcount, inbox, endpoints,
|
||||||
} = actor;
|
} = actor;
|
||||||
preferredUsername = preferredUsername || slugify(name);
|
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;
|
let picture;
|
||||||
if (icon) {
|
if (icon) {
|
||||||
|
|||||||
Reference in New Issue
Block a user