diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 4b156d505fd9f214c29b9dd2f0f8420de0adc0a5..4aba26424e185b1b05cfb74476e383b93cd9c2d0 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3221,8 +3221,6 @@ void LLIMMgr::addPendingAgentListUpdates(
 	{
 		//new school update
 		LLSD update_types = LLSD::emptyArray();
-		LLSD::array_iterator array_iter;
-
 		update_types.append("agent_updates");
 		update_types.append("updates");
 
@@ -3231,7 +3229,7 @@ void LLIMMgr::addPendingAgentListUpdates(
 			//we only want to include the last update for a given agent
 			for (const auto& update_pair : updates[update_type.asStringRef()].map())
 			{
-				mPendingAgentListUpdates[session_id.asString()][array_iter->asString()][update_pair.first] =
+				mPendingAgentListUpdates[session_id.asString()][update_type.asStringRef()][update_pair.first] =
 					update_pair.second;
 			}
 		}