From 7e357189bca2e68881c0d0948e9ea4f4b5b99698 Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Fri, 19 Jan 2024 15:02:21 -0600 Subject: [PATCH] Return null if missing --- ClassTranscribeServer/Controllers/MediaController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClassTranscribeServer/Controllers/MediaController.cs b/ClassTranscribeServer/Controllers/MediaController.cs index 952e29b..b890510 100644 --- a/ClassTranscribeServer/Controllers/MediaController.cs +++ b/ClassTranscribeServer/Controllers/MediaController.cs @@ -42,7 +42,7 @@ public async Task> GetMedia(string id) { var media = await _context.Medias. Include(m => m.Video).ThenInclude(v => v.Transcriptions). - Where(m => m.Id == id).FirstAsync(); + Where(m => m.Id == id).FirstOrDefaultAsync(); if (media == null) {