diff --git a/src/server/api/common/get-host-lower.ts b/src/server/api/common/get-host-lower.ts index 92704b4aa..26ddf6c6d 100644 --- a/src/server/api/common/get-host-lower.ts +++ b/src/server/api/common/get-host-lower.ts @@ -1,5 +1,6 @@ import { toUnicode } from 'punycode'; export default (host: string) => { + if (host == null) return null; return toUnicode(host).toLowerCase(); }; diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts index 7901ac1de..65fd880cd 100644 --- a/src/server/api/endpoints/users/notes.ts +++ b/src/server/api/endpoints/users/notes.ts @@ -28,7 +28,7 @@ export const meta = { }, host: { - validator: $.str.optional, + validator: $.str.optional.nullable, }, includeReplies: {