From 15a28810837407e478c6c7e5cfbfb49702473ed1 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Sun, 11 Nov 2018 18:26:09 +0900
Subject: [PATCH] [API] Fix #3203

---
 src/server/api/common/get-host-lower.ts | 1 +
 src/server/api/endpoints/users/notes.ts | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

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: {