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/MySQL/MySQLSimulationData.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Data/MySQL') diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 42f2ebb..2921c1c 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -616,10 +616,14 @@ namespace OpenSim.Data.MySQL // Legacy region loading 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