From 9024fe68fc3ab5e3e4fde2a88b63ddd67c335490 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 1 May 2008 12:08:22 +0000 Subject: * Insert temporary cast exception catching code to deal with mantis 1099 - mysql inventoryitems table problem --- OpenSim/Data/MySQL/MySQLInventoryData.cs | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 23d2ea5..991e9c7 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -333,12 +333,38 @@ namespace OpenSim.Data.MySQL item.Creator = new LLUUID((string) reader["creatorID"]); item.BasePermissions = (uint) reader["inventoryBasePermissions"]; item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; - item.SalePrice = (int) reader["salePrice"]; + + try + { + item.SalePrice = (int) reader["salePrice"]; + } + catch (InvalidCastException) + { + m_log.WarnFormat("Could not cast salePrice {0} to {1}", reader["salePrice"], "int"); + } + item.SaleType = Convert.ToByte(reader["saleType"]); - item.CreationDate = (int) reader["creationDate"]; + + try + { + item.CreationDate = (int) reader["creationDate"]; + } + catch (InvalidCastException) + { + m_log.WarnFormat("Could not cast creationDate {0} to {1}", reader["creationDate"], "int"); + } + item.GroupID = new LLUUID(reader["groupID"].ToString()); item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); - item.Flags = (uint) reader["flags"]; + + try + { + item.Flags = (uint) reader["flags"]; + } + catch (InvalidCastException) + { + m_log.WarnFormat("Could not cast flags {0} to {1}", reader["flags"], "uint"); + } return item; } -- cgit v1.1