diff --git a/ProjectLighthouse/Controllers/PhotosController.cs b/ProjectLighthouse/Controllers/PhotosController.cs index 97a5d321..9ce5c655 100644 --- a/ProjectLighthouse/Controllers/PhotosController.cs +++ b/ProjectLighthouse/Controllers/PhotosController.cs @@ -74,6 +74,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers public async Task UserPhotos([FromQuery] string user) { User? userFromQuery = await this.database.Users.FirstOrDefaultAsync(u => u.Username == user); + // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (user == null) return this.NotFound(); List photos = await this.database.Photos.Where(p => p.CreatorId == userFromQuery.UserId).Take(10).ToListAsync(); diff --git a/ProjectLighthouse/Types/Photo.cs b/ProjectLighthouse/Types/Photo.cs index ed3af1fd..e6c0f576 100644 --- a/ProjectLighthouse/Types/Photo.cs +++ b/ProjectLighthouse/Types/Photo.cs @@ -1,3 +1,4 @@ +#nullable enable using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations;