summaryrefslogtreecommitdiff
path: root/indra/newview/llaisapi.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-05-21 22:54:52 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-05-22 17:14:48 +0300
commit1357773bd47fc727a5ef055a0eff1c5ed21e124d (patch)
tree951a95f3ca21d934c58f5ccdb84fbe33aa4ae7c9 /indra/newview/llaisapi.cpp
parente88380e464d7a0275556f99e38bd0f67358bcd4e (diff)
#5859 Fix a missed null category check
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rw-r--r--indra/newview/llaisapi.cpp58
1 files changed, 32 insertions, 26 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index f67f2688a1..1c5530916f 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -1758,35 +1758,41 @@ void AISUpdate::doUpdate()
const LLUUID id = ucv_it->first;
S32 version = static_cast<S32>(ucv_it->second);
LLViewerInventoryCategory *cat = gInventory.getCategory(id);
- LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL;
- if (cat->getVersion() != version)
+ // Update can be rather large and take time to process.
+ // By the time update gets to the category, it could
+ // could have been removed by the user
+ if (cat)
{
- // the AIS version should be considered the true version. Adjust
- // our local category model to reflect this version number. Otherwise
- // it becomes possible to get stuck with the viewer being out of
- // sync with the inventory system. Under normal circumstances
- // inventory COF is maintained on the viewer through calls to
- // LLInventoryModel::accountForUpdate when a changing operation
- // is performed. This occasionally gets out of sync however.
- if (version != LLViewerInventoryCategory::VERSION_UNKNOWN)
- {
- LL_WARNS() << "Possible version mismatch for category " << cat->getName()
- << ", viewer version " << cat->getVersion()
- << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL;
- cat->setVersion(version);
- }
- else
+ LL_DEBUGS("Inventory") << "cat " << cat->getName() << " version update from " << cat->getVersion() << " to AIS version " << version << LL_ENDL;
+ if (cat->getVersion() != version)
{
- // We do not account for update if version is UNKNOWN, so we shouldn't rise version
- // either or viewer will get stuck on descendants count -1, try to refetch folder instead
- //
- // Todo: proper backoff?
+ // the AIS version should be considered the true version. Adjust
+ // our local category model to reflect this version number. Otherwise
+ // it becomes possible to get stuck with the viewer being out of
+ // sync with the inventory system. Under normal circumstances
+ // inventory COF is maintained on the viewer through calls to
+ // LLInventoryModel::accountForUpdate when a changing operation
+ // is performed. This occasionally gets out of sync however.
+ if (version != LLViewerInventoryCategory::VERSION_UNKNOWN)
+ {
+ LL_WARNS() << "Possible version mismatch for category " << cat->getName()
+ << ", viewer version " << cat->getVersion()
+ << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL;
+ cat->setVersion(version);
+ }
+ else
+ {
+ // We do not account for update if version is UNKNOWN, so we shouldn't riase version
+ // either or viewer will get stuck on descendants count -1, try to refetch folder instead
+ //
+ // Todo: proper backoff?
- LL_WARNS() << "Possible version mismatch for category " << cat->getName()
- << ", viewer version " << cat->getVersion()
- << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL;
- const S32 LONG_EXPIRY = 360;
- cat->fetch(LONG_EXPIRY);
+ LL_WARNS() << "Possible version mismatch for category " << cat->getName()
+ << ", viewer version " << cat->getVersion()
+ << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL;
+ const S32 LONG_EXPIRY = 360;
+ cat->fetch(LONG_EXPIRY);
+ }
}
}
}