add some null protection on email

From: Sean Dague <sdague@gmail.com>
0.6.0-stable
Sean Dague 2008-11-04 19:26:17 +00:00
parent 972143b592
commit 7d6dc3b099
2 changed files with 3 additions and 2 deletions

View File

@ -540,7 +540,7 @@ namespace OpenSim.Data.MySQL
retval.ID = id;
retval.FirstName = (string) reader["username"];
retval.SurName = (string) reader["lastname"];
retval.Email = (string) reader["email"];
retval.Email = (reader.IsDBNull(reader.GetOrdinal("email"))) ? "" : (string) reader["email"];
retval.PasswordHash = (string) reader["passwordHash"];
retval.PasswordSalt = (string) reader["passwordSalt"];

View File

@ -813,7 +813,8 @@ namespace OpenSim.Data.SQLite
user.ID = tmp;
user.FirstName = (String) row["username"];
user.SurName = (String) row["surname"];
user.Email = (String) row["email"];
user.Email = (row.IsNull("email")) ? "" : (String) row["email"];
user.PasswordHash = (String) row["passwordHash"];
user.PasswordSalt = (String) row["passwordSalt"];