From 7d6dc3b0999d5d4dbe0ec560db43a1de047408b7 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 4 Nov 2008 19:26:17 +0000 Subject: [PATCH] add some null protection on email From: Sean Dague --- OpenSim/Data/MySQL/MySQLManager.cs | 2 +- OpenSim/Data/SQLite/SQLiteUserData.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 7096efaae3..c584eb9371 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -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"]; diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 50a1d73c0c..369fc51460 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -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"];