From ec03690f8dda80b61678cf3c5ad920ca3c1ee031 Mon Sep 17 00:00:00 2001 From: ChuufMaster Date: Sun, 22 Sep 2024 15:17:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20null=20reference=20for=20b?= =?UTF-8?q?ird?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dotnet/BeakPeekApi/Controllers/BirdController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/BeakPeekApi/Controllers/BirdController.cs b/dotnet/BeakPeekApi/Controllers/BirdController.cs index 50a53ae3..9d3855b4 100644 --- a/dotnet/BeakPeekApi/Controllers/BirdController.cs +++ b/dotnet/BeakPeekApi/Controllers/BirdController.cs @@ -294,7 +294,7 @@ public async Task>> GetBirdsByRef(int id) var birds = await _context.Provinces .Include(p => p.Bird) .Include(p => p.Pentad) - .Where(p => p.Bird!.Ref == id) + .Where(p => p.Bird != null && p.Bird.Ref == id) .ToListAsync(); if (birds == null || birds.Count == 0)