From 4448fd4b2f3fb85cd9262e8d8428bdf4c9ca8b2c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 20 Jun 2008 18:46:43 +0000 Subject: * Handle parcel telehub location corruption gracefully. DBNull * mySQL this time. --- OpenSim/Data/MySQL/MySQLDataStore.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'OpenSim/Data/MySQL/MySQLDataStore.cs') diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index ff1b583..b0f02f0 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs @@ -1025,13 +1025,22 @@ namespace OpenSim.Data.MySQL newData.authBuyerID = authedbuyer; newData.snapshotID = snapshotID; - - newData.userLocation = - new LLVector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), - Convert.ToSingle(row["UserLocationZ"])); - newData.userLookAt = - new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), - Convert.ToSingle(row["UserLookAtZ"])); + try + { + newData.userLocation = + new LLVector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), + Convert.ToSingle(row["UserLocationZ"])); + newData.userLookAt = + new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), + Convert.ToSingle(row["UserLookAtZ"])); + } + catch (InvalidCastException) + { + newData.userLocation = LLVector3.Zero; + newData.userLookAt = LLVector3.Zero; + m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.landName); + } + newData.parcelAccessList = new List(); return newData; -- cgit v1.1