mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 07:21:48 +00:00
* Added test for null output of GetItem and log & return if the item cannot be found.
This commit is contained in:
parent
008ac97a64
commit
518a5e8ab1
@ -11697,7 +11697,14 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
containers += StringFormat(" in (%u, %u) ", tsf->object_type, tsf->some_id); // container in inventory
|
containers += StringFormat(" in (%u, %u) ", tsf->object_type, tsf->some_id); // container in inventory
|
||||||
combineObjectSlots = database.GetItem(tsf->some_id)->BagSlots;
|
auto item = database.GetItem(tsf->some_id);
|
||||||
|
if (!item)
|
||||||
|
{
|
||||||
|
Log(Logs::General, Logs::Error, "Invalid container ID: %d. GetItem returned null.\n", tsf->some_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
combineObjectSlots = item->BagSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string favoriteIDs; //gotta be big enough for 500 IDs
|
std::string favoriteIDs; //gotta be big enough for 500 IDs
|
||||||
@ -11762,7 +11769,14 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app)
|
|||||||
else {
|
else {
|
||||||
// container in inventory
|
// container in inventory
|
||||||
snprintf(containers, 29, "in (%u,%u)", rss->object_type, rss->some_id);
|
snprintf(containers, 29, "in (%u,%u)", rss->object_type, rss->some_id);
|
||||||
combineObjectSlots = database.GetItem(rss->some_id)->BagSlots;
|
auto item = database.GetItem(rss->some_id);
|
||||||
|
if (!item)
|
||||||
|
{
|
||||||
|
Log(Logs::General, Logs::Error, "Invalid container ID: %d. GetItem returned null.\n", rss->some_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
combineObjectSlots = item->BagSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string searchClause;
|
std::string searchClause;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user