From 14730f754babd0ac60614b984dfa48035ed4ffb2 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Oct 2021 22:02:36 -0400 Subject: [PATCH] Fix exception on searching slots without a query --- ProjectLighthouse/Controllers/SearchController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ProjectLighthouse/Controllers/SearchController.cs b/ProjectLighthouse/Controllers/SearchController.cs index adaced48..823a89cf 100644 --- a/ProjectLighthouse/Controllers/SearchController.cs +++ b/ProjectLighthouse/Controllers/SearchController.cs @@ -18,6 +18,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers { [HttpGet("slots/search")] public async Task SearchSlots([FromQuery] string query) { + if(query == null) return this.BadRequest(); query = query.ToLower(); string[] keywords = query.Split(" ");