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.
0.7.4.1
Oren Hurvitz 2012-04-23 18:38:21 +03:00 committed by Justin Clark-Casey (justincc)
parent 6011bfa5e3
commit c70e85a327
1 changed files with 5 additions and 1 deletions

View File

@ -187,7 +187,11 @@ namespace OpenSim.Data.MySQL
if (s == "locY")
continue;
ret.Data[s] = result[s].ToString();
object value = result[s];
if (value is DBNull)
ret.Data[s] = null;
else
ret.Data[s] = result[s].ToString();
}
retList.Add(ret);