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,6 +187,10 @@ namespace OpenSim.Data.MySQL
if (s == "locY")
continue;
object value = result[s];
if (value is DBNull)
ret.Data[s] = null;
else
ret.Data[s] = result[s].ToString();
}