In the asset service, check that an asset exists before attempting to store it.

This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-17 23:24:41 +01:00
parent 4a9b8184f7
commit 6b51d8a10e
2 changed files with 13 additions and 6 deletions

View File

@@ -251,12 +251,14 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
/// check if the asset UUID exist in database
/// Check if the asset exists in the database
/// </summary>
/// <param name="uuid">The asset UUID</param>
/// <returns>true if exist.</returns>
/// <returns>true if it exists, false otherwise.</returns>
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)