aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLAssetData.cs27
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
index aa31d3c..38d0a8f 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
@@ -76,20 +76,27 @@ namespace OpenSim.Framework.Data.MySQL
76 _dbConnection.Connection); 76 _dbConnection.Connection);
77 MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); 77 MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
78 p.Value = assetID.GetBytes(); 78 p.Value = assetID.GetBytes();
79 using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 79 try
80 { 80 {
81 if (dbReader.Read()) 81 using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
82 { 82 {
83 asset = new AssetBase(); 83 if (dbReader.Read())
84 asset.Data = (byte[]) dbReader["data"]; 84 {
85 asset.Description = (string) dbReader["description"]; 85 asset = new AssetBase();
86 asset.FullID = assetID; 86 asset.Data = (byte[])dbReader["data"];
87 asset.InvType = (sbyte) dbReader["invType"]; 87 asset.Description = (string)dbReader["description"];
88 asset.Local = ((sbyte) dbReader["local"]) != 0 ? true : false; 88 asset.FullID = assetID;
89 asset.Name = (string) dbReader["name"]; 89 asset.InvType = (sbyte)dbReader["invType"];
90 asset.Type = (sbyte) dbReader["assetType"]; 90 asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false;
91 asset.Name = (string)dbReader["name"];
92 asset.Type = (sbyte)dbReader["assetType"];
93 }
91 } 94 }
92 } 95 }
96 catch (Exception)
97 {
98 MainLog.Instance.Warn("ASSETS", "MySql failure fetching asset");
99 }
93 } 100 }
94 return asset; 101 return asset;
95 } 102 }