diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs index 389996e2..e3437ff5 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs @@ -223,7 +223,9 @@ public class PhotosController : ControllerBase } foreach (string idStr in photo.PhotoSubjectIds) { - if (!int.TryParse(idStr, out int subjectId)) throw new InvalidCastException(idStr + " is not a valid number."); + if (string.IsNullOrWhiteSpace(idStr)) continue; + + if (!int.TryParse(idStr, out int subjectId)) continue; this.database.PhotoSubjects.RemoveWhere(p => p.PhotoSubjectId == subjectId); }