package com.Acrobot.ChestShop.Listeners.Player;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerTeleportEvent;

/**
 * A fix for a CraftBukkit bug.
 *
 * @author Acrobot
 */
public class PlayerTeleport implements Listener {

    @EventHandler
    public static void onPlayerTeleport(PlayerTeleportEvent event) {
        if (event.getPlayer().getOpenInventory().getType() != InventoryType.CRAFTING) {
            event.getPlayer().closeInventory();
        }
    }
}

@@ -412,24 +412,144 @@
 nt event) %7B%0A
+        if (event.getPlayer() == null %7C%7C event.getPlayer().getOpenInventory() == null) %7B%0A            return;%0A        %7D%0A%0A
         if (

Add a prevention from NPE