From b1327dda017716ac70836e3d272a15811337c75b Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 14 May 2008 15:43:19 +0000 Subject: fix for a change in inventory that meant I was returning a lot of empty inventory folders --- OpenSim/Data/NHibernate/NHibernateInventoryData.cs | 45 ++++++++-------------- 1 file changed, 16 insertions(+), 29 deletions(-) (limited to 'OpenSim/Data/NHibernate') diff --git a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs index 8305646..fa75588 100644 --- a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs +++ b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs @@ -392,22 +392,15 @@ namespace OpenSim.Data.NHibernate { using (ISession session = factory.OpenSession()) { - // try - // { - ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); - criteria.Add(Expression.Eq("ParentID", LLUUID.Zero)); - criteria.Add(Expression.Eq("Owner", user)); - foreach (InventoryFolderBase folder in criteria.List()) - { - return folder; - } - m_log.ErrorFormat("No Inventory Root Folder Found for: {0}", user); - return new InventoryFolderBase(); -// } -// catch -// { -// return new InventoryFolderBase(); -// } + ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); + criteria.Add(Expression.Eq("ParentID", LLUUID.Zero)); + criteria.Add(Expression.Eq("Owner", user)); + foreach (InventoryFolderBase folder in criteria.List()) + { + return folder; + } + m_log.ErrorFormat("No Inventory Root Folder Found for: {0}", user); + return null; } } @@ -420,19 +413,13 @@ namespace OpenSim.Data.NHibernate { using (ISession session = factory.OpenSession()) { - // try -// { - ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); - criteria.Add(Expression.Eq("ParentID", parentID)); - foreach (InventoryFolderBase item in criteria.List()) - { - folders.Add(item); - } - // } - // catch - // { - // m_log.ErrorFormat("Can't run getInventoryFolders for Folder ID: {0}", parentID); - // } + + ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); + criteria.Add(Expression.Eq("ParentID", parentID)); + foreach (InventoryFolderBase item in criteria.List()) + { + folders.Add(item); + } } } -- cgit v1.1