mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-15 17:51:28 +00:00
Add missing null checks to CollectionController
This commit is contained in:
parent
f1a6eb48b1
commit
e5cafb1e02
1 changed files with 2 additions and 0 deletions
|
@ -148,6 +148,7 @@ public class CollectionController : ControllerBase
|
|||
GameToken token = this.GetToken();
|
||||
|
||||
User? user = await this.database.UserFromGameToken(token);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
|
||||
string categoriesSerialized = CategoryHelper.Categories.Aggregate
|
||||
(
|
||||
|
@ -193,6 +194,7 @@ public class CollectionController : ControllerBase
|
|||
GameToken token = this.GetToken();
|
||||
|
||||
User? user = await this.database.UserFromGameToken(token);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
|
||||
Category? category = CategoryHelper.Categories.FirstOrDefault(c => c.Endpoint == endpointName);
|
||||
if (category == null) return this.NotFound();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue