Added some nullptr checks for ItemInst* in a few places (tradeskills.cpp - particularly augments - needs a better review)

This commit is contained in:
Uleat
2014-12-23 10:14:45 -05:00
parent ed257b0ef3
commit 34ab3e10f5
14 changed files with 123 additions and 46 deletions
+3 -1
View File
@@ -1229,6 +1229,8 @@ void QuestManager::itemlink(int item_id) {
if (initiator) {
const ItemInst* inst = database.CreateItem(item_id);
char* link = 0;
if (inst == nullptr)
return;
if (initiator->MakeItemLink(link, inst))
initiator->Message(0, "%s tells you, %c%s%s%c", owner->GetCleanName(),
0x12, link, inst->GetItem()->Name, 0x12);
@@ -2336,7 +2338,7 @@ int QuestManager::collectitems_processSlot(int16 slot_id, uint32 item_id,
bool remove)
{
QuestManagerCurrentQuestVars();
ItemInst *item;
ItemInst *item = nullptr;
int quantity = 0;
item = initiator->GetInv().GetItem(slot_id);