aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLRegionData.cs
diff options
context:
space:
mode:
authorOren Hurvitz2012-04-23 18:38:21 +0300
committerJustin Clark-Casey (justincc)2012-04-24 20:46:31 +0100
commitc70e85a3271aaa9e6d892240964cb55cbc2960c7 (patch)
treebaf7dad35f63f9809c1e0b5cf8b32c755e6d478b /OpenSim/Data/MySQL/MySQLRegionData.cs
parentOSSL: fixed the threat level check for osParseJSONNew (diff)
downloadopensim-SC-c70e85a3271aaa9e6d892240964cb55cbc2960c7.zip
opensim-SC-c70e85a3271aaa9e6d892240964cb55cbc2960c7.tar.gz
opensim-SC-c70e85a3271aaa9e6d892240964cb55cbc2960c7.tar.bz2
opensim-SC-c70e85a3271aaa9e6d892240964cb55cbc2960c7.tar.xz
When reading a region, use null objects to represent NULL fields.
Previously NULL fields were converted to an empty string due to the use of ToString(). But if the field was an Int (e.g., "locZ"), then the subsequent attempt to convert an empty string to an int caused an exception. Now the field is null so we don't try to convert it, so there's no exception.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLRegionData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index c20c392..948cdf3 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -187,7 +187,11 @@ namespace OpenSim.Data.MySQL
187 if (s == "locY") 187 if (s == "locY")
188 continue; 188 continue;
189 189
190 ret.Data[s] = result[s].ToString(); 190 object value = result[s];
191 if (value is DBNull)
192 ret.Data[s] = null;
193 else
194 ret.Data[s] = result[s].ToString();
191 } 195 }
192 196
193 retList.Add(ret); 197 retList.Add(ret);