diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index fe9f553ad4..294ad7b5ea 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -628,16 +628,19 @@ export default class Misskey implements MegalodonInterface { } } return this.client.post>('/api/users/search', params).then(res => { + if ((res.data as any)["error"]) { + return Object.assign(res, { + data: { + accounts: [], + statuses: [], + hashtags: [], + } + }) + } return Object.assign(res, { data: res.data.map(u => MisskeyAPI.Converter.userDetail(u, this.baseUrl)) }) - }).catch(() => ({ - data: { - accounts: [], - statuses: [], - hashtags: [], - } - })) + }) } // ======================================