summaryrefslogtreecommitdiff
path: root/indra/newview/llfavoritesbar.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-08-18 19:16:03 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-08-18 19:16:03 +0300
commitcfe0ba90352c48a2b9f5006c4c8e824dc472cdc9 (patch)
tree58515df5648b7a7819b4cb62e88431c1b4747e79 /indra/newview/llfavoritesbar.cpp
parent61e318564e5c492ff7da70ef05f9596c4af8d369 (diff)
parente8b31d03b4f6f0ffb981b4ea150743daf7b4a958 (diff)
Merge branch 'master' into DRTVWR-515-maint
# Conflicts: # indra/newview/llimprocessing.cpp
Diffstat (limited to 'indra/newview/llfavoritesbar.cpp')
-rw-r--r--indra/newview/llfavoritesbar.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 711b3c61e5..7a887a2549 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1598,14 +1598,29 @@ void LLFavoritesOrderStorage::load()
<< (fav_llsd.isMap() ? "" : "un") << "successfully"
<< LL_ENDL;
in_file.close();
- user_llsd = fav_llsd[gAgentUsername];
+ if (fav_llsd.isMap() && fav_llsd.has(gAgentUsername))
+ {
+ user_llsd = fav_llsd[gAgentUsername];
- S32 index = 0;
- for (LLSD::array_iterator iter = user_llsd.beginArray();
+ S32 index = 0;
+ bool needs_validation = gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin");
+ for (LLSD::array_iterator iter = user_llsd.beginArray();
iter != user_llsd.endArray(); ++iter)
- {
- mSortIndexes.insert(std::make_pair(iter->get("id").asUUID(), index));
- index++;
+ {
+ // Validation
+ LLUUID fv_id = iter->get("id").asUUID();
+ if (needs_validation
+ && (fv_id.isNull()
+ || iter->get("asset_id").asUUID().isNull()
+ || iter->get("name").asString().empty()
+ || iter->get("slurl").asString().empty()))
+ {
+ mRecreateFavoriteStorage = true;
+ }
+
+ mSortIndexes.insert(std::make_pair(fv_id, index));
+ index++;
+ }
}
}
else
@@ -1849,6 +1864,8 @@ void LLFavoritesOrderStorage::rearrangeFavoriteLandmarks(const LLUUID& source_it
BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
{
+ pref_changed |= mRecreateFavoriteStorage;
+ mRecreateFavoriteStorage = false;
LLUUID favorite_folder= gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
if (favorite_folder.isNull())