Fixing 500 error when entering a bad itemid when creating an auction
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user