From 221c5ae877b9a60719c66b92b7ea6bb5b78f7b9f Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sat, 23 Dec 2023 16:29:02 -0500
Subject: [PATCH] Possibly fix crash

---
 indra/newview/llagent.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 0b761db81a9..bdad193d852 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -5392,6 +5392,12 @@ void LLAgent::requestAgentUserInfoCoro(std::string capurl)
         return;
     }
 
+	if (result.size() == 0 || !result.isMap())
+	{
+		LL_WARNS("UserInfo") << "Failed to get user information." << LL_ENDL;
+		return;
+	}
+
     bool im_via_email = false;
     bool is_verified_email = false;
     std::string email;
@@ -5401,9 +5407,11 @@ void LLAgent::requestAgentUserInfoCoro(std::string capurl)
 		im_via_email = result["im_via_email"].asBoolean();
 
 	if (result.has("is_verified"))
-		im_via_email = result["is_verified"].asBoolean();
+		is_verified_email = result["is_verified"].asBoolean();
+
+	if (result.has("email"))
+    	email = result["email"].asString();
 
-    email = result["email"].asString();
     dir_visibility = result["directory_visibility"].asString();
 
     // TODO: This should probably be changed.  I'm not entirely comfortable 
-- 
GitLab