From f8b17854676eafab64712a2bbde3de696719a603 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 20 Jun 2008 17:07:01 +0000 Subject: * Handle parcel telehub location corruption gracefully. DBNull --- OpenSim/Data/SQLite/SQLiteRegionData.cs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index cc059af..36202b9 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -972,13 +972,22 @@ namespace OpenSim.Data.SQLite newData.passHours = Convert.ToSingle(row["PassHours"]); newData.passPrice = Convert.ToInt32(row["PassPrice"]); newData.snapshotID = (String) row["SnapshotUUID"]; + 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"])); + 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"])); + m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.landName); + } + catch (InvalidCastException) + { + newData.userLocation = LLVector3.Zero; + newData.userLookAt = LLVector3.Zero; + } newData.parcelAccessList = new List(); LLUUID authBuyerID = LLUUID.Zero; -- cgit v1.1