mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #12667; handle cases where received id is not a URL
This commit is contained in:
@@ -36,6 +36,7 @@ Mocks.profile = async (actors) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const uid = actor.id;
|
const uid = actor.id;
|
||||||
|
let hostname;
|
||||||
let {
|
let {
|
||||||
url, preferredUsername, published, icon, image,
|
url, preferredUsername, published, icon, image,
|
||||||
name, summary, followers, followerCount, followingCount,
|
name, summary, followers, followerCount, followingCount,
|
||||||
@@ -43,7 +44,11 @@ Mocks.profile = async (actors) => {
|
|||||||
} = actor;
|
} = actor;
|
||||||
preferredUsername = preferredUsername || slugify(name);
|
preferredUsername = preferredUsername || slugify(name);
|
||||||
|
|
||||||
const { hostname } = new URL(actor.id);
|
try {
|
||||||
|
({ hostname } = new URL(actor.id));
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
let picture;
|
let picture;
|
||||||
if (icon) {
|
if (icon) {
|
||||||
|
|||||||
Reference in New Issue
Block a user