* Insert temporary cast exception catching code to deal with mantis 1099 - mysql inventoryitems table problem

0.6.0-stable
Justin Clarke Casey 2008-05-01 12:08:22 +00:00
parent 1c697ef0d2
commit 9024fe68fc
1 changed files with 29 additions and 3 deletions

View File

@ -333,12 +333,38 @@ namespace OpenSim.Data.MySQL
item.Creator = new LLUUID((string) reader["creatorID"]); item.Creator = new LLUUID((string) reader["creatorID"]);
item.BasePermissions = (uint) reader["inventoryBasePermissions"]; item.BasePermissions = (uint) reader["inventoryBasePermissions"];
item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; 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.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.GroupID = new LLUUID(reader["groupID"].ToString());
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); 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; return item;
} }