From 225c89a5b81c3a02fc63b25c0f33f507561e5477 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Sat, 21 Jan 2017 07:45:49 +0900
Subject: [PATCH] [API] Fix bug

---
 src/api/streaming.ts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/api/streaming.ts b/src/api/streaming.ts
index 8348d7c38f..17db59fd0a 100644
--- a/src/api/streaming.ts
+++ b/src/api/streaming.ts
@@ -51,6 +51,10 @@ module.exports = (server: http.Server) => {
 };
 
 function authenticate(connection: websocket.connection, token: string): Promise<any> {
+	if (token == null) {
+		return Promise.resolve(null);
+	}
+
 	return new Promise(async (resolve, reject) => {
 		if (isNativeToken(token)) {
 			// Fetch user