aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/search.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/search.ts')
-rw-r--r--server/controllers/api/search.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts
index d95e7cac9..f408e7932 100644
--- a/server/controllers/api/search.ts
+++ b/server/controllers/api/search.ts
@@ -39,8 +39,9 @@ export { searchRouter }
39 39
40function searchVideos (req: express.Request, res: express.Response) { 40function searchVideos (req: express.Request, res: express.Response) {
41 const query: VideosSearchQuery = req.query 41 const query: VideosSearchQuery = req.query
42 if (query.search.startsWith('http://') || query.search.startsWith('https://')) { 42 const search = query.search
43 return searchVideoUrl(query.search, res) 43 if (search && (search.startsWith('http://') || search.startsWith('https://'))) {
44 return searchVideoUrl(search, res)
44 } 45 }
45 46
46 return searchVideosDB(query, res) 47 return searchVideosDB(query, res)