From 9a65a666e7e4779552e6bf0a1d51a4857ef1eead Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 30 Jan 2024 09:37:33 -0500
Subject: [PATCH] Fix crash due to region being nullptr

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

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index f09e2cb8e15..f1b7a3ba2e5 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3204,7 +3204,7 @@ void LLIMMgr::addMessage(
             // Fetch group chat history, enabled by default.
             if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory"))
             {
-                std::string chat_url = gAgent.getRegion()->getCapability("ChatSessionRequest");
+                std::string chat_url = gAgent.getRegionCapability("ChatSessionRequest");
                 LLCoros::instance().launch("chatterBoxHistoryCoro",
                     boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp));
             }
@@ -4057,7 +4057,7 @@ class LLViewerChatterBoxSessionStartReply : public LLHTTPNode
                     // Send request for chat history, if enabled.
                     if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory"))
                     {
-                        std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest");
+                        std::string url = gAgent.getRegionCapability("ChatSessionRequest");
                         LLCoros::instance().launch("chatterBoxHistoryCoro",
                             boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0));
                     }
@@ -4222,7 +4222,7 @@ class LLViewerChatterBoxInvitation : public LLHTTPNode
 			if ((pGroupOptions && !pGroupOptions->mReceiveGroupChat)
 				|| LLMuteList::instance().isGroupMuted(session_id))
 			{
-				const std::string strUrl = gAgent.getRegion()->getCapability("ChatSessionRequest");
+				const std::string strUrl = gAgent.getRegionCapability("ChatSessionRequest");
 				if (!strUrl.empty())
 				{
 					LLSD sdData;
-- 
GitLab