From 4030bdef03759e0b61e4a2929f17fb610314a38e Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Thu, 11 Jan 2024 22:05:47 -0500 Subject: [PATCH] Fix nullptr crash in AO --- indra/newview/aoengine.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index e29c581308f..b5e9d2e5463 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -1205,25 +1205,27 @@ bool AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 inde } LLViewerInventoryItem* item = gInventory.getItem(state->mAnimations[index].mInventoryUUID); - - // check if this item is actually an animation link - bool move = true; - if (item->getIsLinkType()) + if (item) { - if (item->getInventoryType() == LLInventoryType::IT_ANIMATION) + // check if this item is actually an animation link + bool move = true; + if (item->getIsLinkType()) { - // it is an animation link, so mark it to be purged - move = false; + if (item->getInventoryType() == LLInventoryType::IT_ANIMATION) + { + // it is an animation link, so mark it to be purged + move = false; + } } - } - // this item was not an animation link, move it to lost and found - if (move) - { - gInventory.changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), false); - LLNotificationsUtil::add("AOForeignItemsFound", LLSD()); - update(); - return false; + // this item was not an animation link, move it to lost and found + if (move) + { + gInventory.changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), false); + LLNotificationsUtil::add("AOForeignItemsFound", LLSD()); + update(); + return false; + } } // purge the item from inventory -- GitLab