Skip to content

Commit

Permalink
Merge pull request #267 from COS301-SE-2024/dev/fix/null_ref
Browse files Browse the repository at this point in the history
🔀 Fix null refernce for bird
  • Loading branch information
ChuufMaster authored Sep 22, 2024
2 parents 40c7f94 + ec03690 commit 29fcdcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dotnet/BeakPeekApi/Controllers/BirdController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public async Task<ActionResult<IEnumerable<ProvinceDto>>> 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)
Expand Down

0 comments on commit 29fcdcc

Please sign in to comment.