Fixed a possible mapserver crash

This commit is contained in:
Lemongrass3110 2018-08-16 21:15:25 +02:00
parent 3d8104d7fb
commit ae89b3a7b2

View File

@ -143,7 +143,7 @@ enum mail_attach_result mail_setitem(struct map_session_data *sd, short idx, uin
idx -= 2;
if( idx < 0 || idx >= MAX_INVENTORY )
if( idx < 0 || idx >= MAX_INVENTORY || sd->inventory_data[idx] == nullptr )
return MAIL_ATTACH_ERROR;
#if PACKETVER < 20150513