POSTGRES: Added check for Heightfield not equal to Database NULL.. Mirrors OpenSim commit 50d738

Signed-off-by: Kevin Cozens <kevin@ve3syb.ca>  (mantis #7845)
LSLKeyTest
Geir Nøklebye 2016-03-16 15:02:04 +01:00 committed by Kevin Cozens
parent 6f13d1e3df
commit b91cfcca2b
1 changed files with 7 additions and 2 deletions

9
OpenSim/Data/PGSQL/PGSQLSimulationData.cs Normal file → Executable file
View File

@ -31,11 +31,13 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Threading;
using log4net; using log4net;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Data;
using Npgsql; using Npgsql;
namespace OpenSim.Data.PGSQL namespace OpenSim.Data.PGSQL
@ -552,8 +554,11 @@ namespace OpenSim.Data.PGSQL
if (reader.Read()) if (reader.Read())
{ {
rev = Convert.ToInt32(reader["Revision"]); rev = Convert.ToInt32(reader["Revision"]);
byte[] blob = (byte[])reader["Heightfield"]; if ((reader["Heightfield"] != DBNull.Value))
terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob); {
byte[] blob = (byte[])reader["Heightfield"];
terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
}
} }
else else
{ {