Fix potential crash in #iteminfo

This commit is contained in:
Michael Cook (mackal) 2016-08-13 15:46:35 -04:00
parent ab35f8b842
commit a8db4532d0

View File

@ -4339,7 +4339,10 @@ void command_goto(Client *c, const Seperator *sep)
void command_iteminfo(Client *c, const Seperator *sep)
{
auto inst = c->GetInv()[EQEmu::legacy::SlotCursor];
if (!inst) { c->Message(13, "Error: You need an item on your cursor for this command"); }
if (!inst) {
c->Message(13, "Error: You need an item on your cursor for this command");
return;
}
auto item = inst->GetItem();
if (!item) {
Log.Out(Logs::General, Logs::Inventory, "(%s) Command #iteminfo processed an item with no data pointer");