From e5d59dc696e647624047465e0e718f2c65106b3c Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 28 Jan 2014 15:29:06 -0800 Subject: Repair database routines so they properly return null when asked for the heighmap of a region that does not exist. --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Data/MSSQL/MSSQLSimulationData.cs') diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index 9f5991b..1a5ecd6 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -531,10 +531,14 @@ ELSE /// public double[,] LoadTerrain(UUID regionID) { + double[,] ret = null; TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight); - return terrData.GetDoubles(); + if (terrData != null) + ret = terrData.GetDoubles(); + return ret; } + // Returns 'null' if region not found public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) { TerrainData terrData = null; -- cgit v1.1