mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-14 13:52:28 +00:00
Fix game server photo deletion bug
Fix bug where users couldn't delete photos with empty subjects
This commit is contained in:
parent
9750e469d8
commit
5e82827fc0
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue