From 6b51d8a10e44eed7c39b58aab256789ab188ecca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 17 Aug 2011 23:24:41 +0100 Subject: In the asset service, check that an asset exists before attempting to store it. --- OpenSim/Data/MySQL/MySQLAssetData.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Data/MySQL/MySQLAssetData.cs') diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index e740232..a743479 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -251,12 +251,14 @@ namespace OpenSim.Data.MySQL } /// - /// check if the asset UUID exist in database + /// Check if the asset exists in the database /// /// The asset UUID - /// true if exist. + /// true if it exists, false otherwise. override public bool ExistsAsset(UUID uuid) { +// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid); + bool assetExists = false; lock (m_dbLock) @@ -273,7 +275,10 @@ namespace OpenSim.Data.MySQL using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if (dbReader.Read()) + { +// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid); assetExists = true; + } } } catch (Exception e) -- cgit v1.1