From 5a12802503b8e557b5cdd99202466bb293a4474f Mon Sep 17 00:00:00 2001
From: Vadim Savchuk <vsavchuk@productengine.com>
Date: Fri, 26 Mar 2010 19:02:14 +0200
Subject: [PATCH] Fixed bug EXT-6268 (Group spawns Resident inspector when
 called from About Land > Objects for group deeded object)

Reason: groups were added to the list as avatars, which led to invoking
incorrect inspector on hover.
Also added a fix for potential crash on hovering name list items.

Reviewed by Leyla: https://codereview.productengine.com/secondlife/r/110/

--HG--
branch : product-engine
---
 indra/newview/llfloaterland.cpp  |  2 +-
 indra/newview/llnamelistctrl.cpp | 24 +++++++++++++++++++-----
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 65003d9b5c8..5dc63b7ef23 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1612,7 +1612,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
 		item_params.columns.add().value(object_count_str).font(FONT).column("count");
 		item_params.columns.add().value(LLDate((time_t)most_recent_time)).font(FONT).column("mostrecent").type("date");
 
-		self->mOwnerList->addRow(item_params);
+		self->mOwnerList->addNameItemRow(item_params);
 
 		lldebugs << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent")
 				<< ") owns " << object_count << " objects." << llendl;
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 7a538e372b9..9611c286eb2 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -148,16 +148,30 @@ void	LLNameListCtrl::mouseOverHighlightNthItem( S32 target_index )
 		if(0 <= cur_index && cur_index < (S32)getItemList().size())
 		{
 			LLScrollListItem* item = getItemList()[cur_index];
-			LLScrollListText* cell = dynamic_cast<LLScrollListText*>(item->getColumn(mNameColumnIndex));
-			if(cell)
-				cell->setTextWidth(cell->getTextWidth() + info_icon_size);
+			if (item)
+			{
+				LLScrollListText* cell = dynamic_cast<LLScrollListText*>(item->getColumn(mNameColumnIndex));
+				if (cell)
+					cell->setTextWidth(cell->getTextWidth() + info_icon_size);
+			}
+			else
+			{
+				llwarns << "highlighted name list item is NULL" << llendl;
+			}
 		}
 		if(target_index != -1)
 		{
 			LLScrollListItem* item = getItemList()[target_index];
 			LLScrollListText* cell = dynamic_cast<LLScrollListText*>(item->getColumn(mNameColumnIndex));
-			if(cell)
-				cell->setTextWidth(cell->getTextWidth() - info_icon_size);
+			if (item)
+			{
+				if (cell)
+					cell->setTextWidth(cell->getTextWidth() - info_icon_size);
+			}
+			else
+			{
+				llwarns << "target name item is NULL" << llendl;
+			}
 		}
 	}
 
-- 
GitLab