Fixing 500 error when entering a bad itemid when creating an auction

This commit is contained in:
hz
2025-06-05 09:44:04 -05:00
parent ea25e3b63d
commit a88e50d111
3 changed files with 42 additions and 2 deletions
+3
View File
@@ -29,6 +29,9 @@ public class ItemService
public virtual async Task<Item> GetByIdAsync(string id)
{
if (!MongoDB.Bson.ObjectId.TryParse(id, out _))
return null;
return await _items.Find(i => i.Id == id).FirstOrDefaultAsync();
}