From eac3fd51f052691e6d0ed899ddeb00b128220928 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 30 Apr 2008 16:41:05 +0000 Subject: * Deal with a situation where the new fields in the inventory store are null on sqlite * This is due to a preparatory change I made yesterday --- OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'OpenSim/Data/SQLite') diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index 5122167..1c60938 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -103,12 +103,24 @@ namespace OpenSim.Data.SQLite item.EveryOnePermissions = Convert.ToUInt32(row["inventoryEveryOnePermissions"]); // new fields - item.SalePrice = Convert.ToInt32(row["salePrice"]); - item.SaleType = Convert.ToByte(row["saleType"]); - item.CreationDate = Convert.ToInt32(row["creationDate"]); - item.GroupID = new LLUUID((string)row["groupID"]); - item.GroupOwned = Convert.ToBoolean(row["groupOwned"]); - item.Flags = Convert.ToUInt32(row["Flags"]); + if (!Convert.IsDBNull(row["salePrice"])) + item.SalePrice = Convert.ToInt32(row["salePrice"]); + + if (!Convert.IsDBNull(row["saleType"])) + item.SaleType = Convert.ToByte(row["saleType"]); + + if (!Convert.IsDBNull(row["creationDate"])) + item.CreationDate = Convert.ToInt32(row["creationDate"]); + + if (!Convert.IsDBNull(row["groupID"])) + item.GroupID = new LLUUID((string)row["groupID"]); + + if (!Convert.IsDBNull(row["groupOwned"])) + item.GroupOwned = Convert.ToBoolean(row["groupOwned"]); + + if (!Convert.IsDBNull(row["Flags"])) + item.Flags = Convert.ToUInt32(row["Flags"]); + return item; } -- cgit v1.1