Bukkit/CraftBukkit — pull request #507 by Brettflan (2011-10-12 23:17:15+00:00)
Title: Fix for NPE in CraftWorld.preserveChunk(), when passed a null chunk.

Example NPE, seemingly when trying to unload a chunk which hasn't been created yet:
java.lang.NullPointerException
at org.bukkit.craftbukkit.CraftWorld.preserveChunk(CraftWorld.java:57)
at org.bukkit.craftbukkit.CraftWorld.unloadChunk(CraftWorld.java:164)

I get that NPE when running my WorldBorder plugin's trimming task, which worked fine in RB 1240 but gets that NPE in newer CB versions.

I've tested the included null check and confirmed that it takes care of the NPE and causes no apparent ill effects.