Print error if the world was deleted

Warzones created in worlds that are then deleted can cause a stack
trace to dump in the error log. This replaces the stack trace with
an informative error message.

Closes #774
This commit is contained in:
cmastudios 2014-04-28 19:03:05 -05:00
parent aeda124c1c
commit 463d51d41b
1 changed files with 1 additions and 0 deletions

View File

@ -262,6 +262,7 @@ public class ZoneVolumeMapper {
public static void loadStructure(Volume volume, Connection databaseConnection) throws SQLException {
String prefix = String.format("structure_%d", volume.getName().hashCode() & Integer.MAX_VALUE);
World world = volume.getWorld();
Validate.notNull(world, String.format("Cannot find the warzone for %s", prefix));
Statement stmt = databaseConnection.createStatement();
ResultSet cornerQuery = stmt.executeQuery("SELECT * FROM " + prefix + "_corners");
cornerQuery.next();