Attempt to handle MYSQL error fetching assets
parent
011ad46960
commit
232613638f
|
@ -76,20 +76,27 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
_dbConnection.Connection);
|
_dbConnection.Connection);
|
||||||
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
|
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
|
||||||
p.Value = assetID.GetBytes();
|
p.Value = assetID.GetBytes();
|
||||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
try
|
||||||
{
|
{
|
||||||
if (dbReader.Read())
|
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
asset = new AssetBase();
|
if (dbReader.Read())
|
||||||
asset.Data = (byte[]) dbReader["data"];
|
{
|
||||||
asset.Description = (string) dbReader["description"];
|
asset = new AssetBase();
|
||||||
asset.FullID = assetID;
|
asset.Data = (byte[])dbReader["data"];
|
||||||
asset.InvType = (sbyte) dbReader["invType"];
|
asset.Description = (string)dbReader["description"];
|
||||||
asset.Local = ((sbyte) dbReader["local"]) != 0 ? true : false;
|
asset.FullID = assetID;
|
||||||
asset.Name = (string) dbReader["name"];
|
asset.InvType = (sbyte)dbReader["invType"];
|
||||||
asset.Type = (sbyte) dbReader["assetType"];
|
asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false;
|
||||||
|
asset.Name = (string)dbReader["name"];
|
||||||
|
asset.Type = (sbyte)dbReader["assetType"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
MainLog.Instance.Warn("ASSETS", "MySql failure fetching asset");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return asset;
|
return asset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue