Add null guard for media types in stats upload controller.

This commit is contained in:
2025-09-26 22:34:10 +01:00
parent 9bfeeab1e6
commit 71fbd5785f

View File

@@ -265,6 +265,8 @@ public sealed class UploadStatsController : ControllerBase
{
foreach(MediaStats media in newstats.Medias)
{
if(media.MediaType == null) continue;
Media? existing =
await _ctx.Medias.FirstOrDefaultAsync(c => c.Type == media.MediaType && c.Real == media.real);