From 94d718c15002b0c3e99ac14bad8379bde81d36f0 Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Mon, 13 Jan 2020 19:46:10 +0200
Subject: [PATCH] =?UTF-8?q?SL-12556=20Fixed=20The=20=E2=80=98Log=20In?=
 =?UTF-8?q?=E2=80=99=20button=20being=20active=20with=20empty=20fields?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 indra/newview/llpanellogin.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 4edcf4a47d7..dd4ca261ff3 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -609,15 +609,19 @@ void LLPanelLogin::setFields(LLPointer<LLCredential> credential)
 		    login_id += " ";
 		    login_id += lastname;
 	    }
-		sInstance->getChild<LLComboBox>("username_combo")->setLabel(login_id);	
+		sInstance->getChild<LLComboBox>("username_combo")->setLabel(login_id);
+		sInstance->mUsernameLength = login_id.length();
 	}
 	else if(identifier.has("type") && (std::string)identifier["type"] == "account")
 	{
-		sInstance->getChild<LLComboBox>("username_combo")->setLabel((std::string)identifier["account_name"]);		
+		std::string login_id = identifier["account_name"].asString();
+		sInstance->getChild<LLComboBox>("username_combo")->setLabel(login_id);
+		sInstance->mUsernameLength = login_id.length();
 	}
 	else
 	{
-		sInstance->getChild<LLComboBox>("username_combo")->setLabel(std::string());	
+		sInstance->getChild<LLComboBox>("username_combo")->setLabel(std::string());
+		sInstance->mUsernameLength = 0;
 	}
 
 	sInstance->addFavoritesToStartLocation();
@@ -641,7 +645,8 @@ void LLPanelLogin::setFields(LLPointer<LLCredential> credential)
 	}
 	else
 	{
-		sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string());		
+		sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string());
+		sInstance->mPasswordLength = 0;
 	}
 }
 
@@ -1250,6 +1255,9 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
             // selection failed, just deselect whatever might be selected
             user_combo->setValue(std::string());
             getChild<LLUICtrl>("password_edit")->setValue(std::string());
+            mUsernameLength = 0;
+            mPasswordLength = 0;
+            updateLoginButtons();
         }
         else
         {
-- 
GitLab