add handling for invalid db items in the sell command
@@ -477,6 +477,10 @@ class Econ(commands.Cog):
item = amount_item[4:]
db_item = await self.db.fetch_item(ctx.author.id, item)
+ if db_item is None:
+ await self.bot.send(ctx, ctx.l.econ.sell.invalid_item)
+ return
+
amount = db_item['amount']
else:
split = amount_item.split(' ')
