aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index 1253e0b..6cbb2ee 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -148,19 +148,16 @@ namespace OpenSim.Data.MySQL
148 148
149 foreach (string name in m_Fields.Keys) 149 foreach (string name in m_Fields.Keys)
150 { 150 {
151 if (m_Fields[name].GetValue(row) is bool) 151 if (m_Fields[name].FieldType == typeof(bool))
152 { 152 {
153 int v = Convert.ToInt32(reader[name]); 153 int v = Convert.ToInt32(reader[name]);
154 m_Fields[name].SetValue(row, v != 0 ? true : false); 154 m_Fields[name].SetValue(row, v != 0 ? true : false);
155 } 155 }
156 else if (m_Fields[name].GetValue(row) is UUID) 156 else if (m_Fields[name].FieldType == typeof(UUID))
157 { 157 {
158 UUID uuid = UUID.Zero; 158 m_Fields[name].SetValue(row, DBGuid.FromDB(reader[name]));
159
160 UUID.TryParse(reader[name].ToString(), out uuid);
161 m_Fields[name].SetValue(row, uuid);
162 } 159 }
163 else if (m_Fields[name].GetValue(row) is int) 160 else if (m_Fields[name].FieldType == typeof(int))
164 { 161 {
165 int v = Convert.ToInt32(reader[name]); 162 int v = Convert.ToInt32(reader[name]);
166 m_Fields[name].SetValue(row, v); 163 m_Fields[name].SetValue(row, v);