NullPointerException on Reload?

Discussion in 'Plugin Development' started by Felixx61, Nov 27, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Felixx61

    Hi,

    My plugin works fine up until the point I reload the server. Once I reload, I get
    which points to this line
    Code:
      @EventHandler
        public void onPlayerMove(PlayerMoveEvent event) {
            if (fromBukkitPlayer(event.getPlayer()).isFrozen()) {
                event.setCancelled(true);
            }
      }
    Now, this only happens when I reload, not when I restart. If I restart the error is gone up until the point where I reload. I believe the player is set to null and never updated, which is what causes this to fire.

    Any help please?

    Thanks
     
  2. Offline

    PolarCraft

    What is the variable ".isFrozen"?
     
  3. Offline

    Felixx61


    Code:
        private boolean frozen;
     
    ...
     
      public boolean isFrozen() {
            return frozen;
        }
     
  4. Offline

    PolarCraft

    There is nothing set for the variable so it will return null.
     
  5. Offline

    Cirno

    I believe "boolean" would automatically default to false since it's a primitive type.

    Felixx61
    What does "fromBukkitPlayer" do?
     
Thread Status:
Not open for further replies.

Share This Page