From 12108bf6e9dc16b6b4b1fe344c1b12ed31a1e4b4 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 23 Nov 2014 14:25:48 -0500 Subject: Fix handling of user preference updates where no email address is supplied --- OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data/PGSQL') diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs index 4a08100..e263857 100644 --- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs +++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs @@ -901,7 +901,10 @@ namespace OpenSim.Data.PGSQL reader.Read(); bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); bool.TryParse((string)reader["visible"], out pref.Visible); - pref.EMail = (string)reader["email"]; + pref.EMail = (string)reader["email"]; + + if(string.IsNullOrEmpty(pref.EMail)) + pref.EMail = "No EMail Address Provided"; } else { @@ -935,7 +938,8 @@ namespace OpenSim.Data.PGSQL query += "UPDATE usersettings SET "; query += "imviaemail=:ImViaEmail, "; - query += "visible=:Visible,"; + query += "visible=:Visible, "; + query += "email=:Email "; query += "WHERE useruuid=:uuid"; try @@ -946,7 +950,8 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) { cmd.Parameters.Add(m_database.CreateParameter("ImViaEmail", pref.IMViaEmail.ToString().ToLower ())); - cmd.Parameters.Add(m_database.CreateParameter("Visible", pref.Visible.ToString().ToLower ())); + cmd.Parameters.Add(m_database.CreateParameter("Visible", pref.Visible.ToString().ToLower ())); + cmd.Parameters.Add(m_database.CreateParameter("EMail", pref.EMail.ToString().ToLower ())); cmd.Parameters.Add(m_database.CreateParameter("uuid", pref.UserId.ToString())); lock(Lock) -- cgit v1.1