From 7a402e352d1982e6361c966590eb07556418154b Mon Sep 17 00:00:00 2001
From: Maxim Nikolenko <maximnproductengine@lindenlab.com>
Date: Wed, 5 Apr 2023 00:10:08 +0300
Subject: SL-19379 selection fix

---
 indra/newview/llinventorygallery.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 8c2f4c2214..b964ecff05 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -794,7 +794,7 @@ void LLInventoryGallery::showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLU
 
 void LLInventoryGallery::changeItemSelection(const LLUUID& item_id)
 {
-    if ((mItemMap.count(item_id) > 0) && (mSelectedItemID == item_id))
+    if ((mItemMap.count(item_id) == 0) || (mSelectedItemID == item_id))
         return;
 
     if (mItemMap[mSelectedItemID])
@@ -1136,6 +1136,7 @@ LLInventoryGalleryItem::LLInventoryGalleryItem(const Params& p)
     mUUID(LLUUID()),
     mIsFolder(true),
     mIsLink(false),
+    mHidden(false),
     mGallery(NULL),
     mType(LLAssetType::AT_NONE),
     mSortGroup(SG_ITEM)
@@ -1151,9 +1152,8 @@ BOOL LLInventoryGalleryItem::postBuild()
 {
     mNameText = getChild<LLTextBox>("item_name");
     mSuffixText = getChild<LLTextBox>("suffix_text");
-
     mTextBgPanel = getChild<LLPanel>("text_bg_panel");
-    mHidden = false;
+
     return TRUE;
 }
 
-- 
cgit v1.2.3