From b91cfcca2b85f886793aad73a06c7319f19a52e9 Mon Sep 17 00:00:00 2001 From: Geir Nøklebye Date: Wed, 16 Mar 2016 15:02:04 +0100 Subject: POSTGRES: Added check for Heightfield not equal to Database NULL.. Mirrors OpenSim commit 50d738 Signed-off-by: Kevin Cozens (mantis #7845) --- OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) mode change 100644 => 100755 OpenSim/Data/PGSQL/PGSQLSimulationData.cs (limited to 'OpenSim/Data/PGSQL') diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs old mode 100644 new mode 100755 index a006c58..960e7f6 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -31,11 +31,13 @@ using System.Data; using System.Drawing; using System.IO; using System.Reflection; +using System.Threading; using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Data; using Npgsql; namespace OpenSim.Data.PGSQL @@ -552,8 +554,11 @@ namespace OpenSim.Data.PGSQL if (reader.Read()) { rev = Convert.ToInt32(reader["Revision"]); - byte[] blob = (byte[])reader["Heightfield"]; - terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob); + if ((reader["Heightfield"] != DBNull.Value)) + { + byte[] blob = (byte[])reader["Heightfield"]; + terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob); + } } else { -- cgit v1.1