Buggy code:
public class JailPlayerProtectionListener extends PlayerListener { private Jail plugin ; public JailPlayerProtectionListener ( Jail instance ) { } public void onPlayerChat ( PlayerChatEvent event ) { } public void onPlayerCommandPreprocess ( PlayerCommandPreprocessEvent event ) { } public void onPlayerMove ( PlayerMoveEvent event ) { } public void onPlayerTeleport ( PlayerTeleportEvent event ) { } public void onPlayerInteract ( PlayerInteractEvent event ) { if ( ( ( ( event . getAction ( ) ) == ( Action . RIGHT_CLICK_BLOCK ) ) && ( ( event . getClickedBlock ( ) . getType ( ) ) == ( Material . CHEST ) ) ) && ( ( prisoners . containsKey ( event . getPlayer ( ) . getName ( ) . toLowerCase ( ) ) ) || ( ! ( Util . permission ( event . getPlayer ( ) , "jail.openchest" , OP ) ) ) ) ) { for ( JailZone jail : zones . values ( ) ) for ( JailCell cell : jail . getCellList ( ) ) { if ( ( ( ! ( jail . getSettings ( ) . getBoolean ( CanPrisonerOpenHisChest ) ) ) || ( ! ( cell . getPlayerName ( ) . toLowerCase ( ) . equals ( event . getPlayer ( ) . getName ( ) . toLowerCase ( ) ) ) ) ) && ( ( ( ( cell . getChest ( ) ) != null ) && ( ( event . getClickedBlock ( ) ) == ( cell . getChest ( ) . getBlock ( ) ) ) ) || ( ( ( cell . getSecondChest ( ) ) != null ) && ( ( event . getClickedBlock ( ) ) == ( cell . getSecondChest ( ) . getBlock ( ) ) ) ) ) ) { event . setCancelled ( true ) ; return ; } } } JailPrisoner prisoner = prisoners . get ( event . getPlayer ( ) . getName ( ) . toLowerCase ( ) ) ; <START_BUG> if ( prisoner != null ) { <END_BUG> JailZone jail = prisoner . getJail ( ) ; if ( ( event . getClickedBlock ( ) ) != null ) { int id = event . getClickedBlock ( ) . getTypeId ( ) ; if ( jail . getSettings ( ) . getList ( PreventInteractionBlocks ) . contains ( String . valueOf ( id ) ) ) { if ( ( ( ( event . getAction ( ) ) != ( Action . PHYSICAL ) ) && ( ( jail . getSettings ( ) . getInt ( InteractionPenalty ) ) > 0 ) ) && ( ( prisoner . getRemainingTime ( ) ) > 0 ) ) { Util . Message ( jail . getSettings ( ) . getString ( MessagePreventedInteractionPenalty ) , event . getPlayer ( ) ) ; prisoner . setRemainingTime ( ( ( prisoner . getRemainingTime ( ) ) + ( ( jail . getSettings ( ) . getInt ( InteractionPenalty ) ) * 6 ) ) ) ; InputOutput . UpdatePrisoner ( prisoner ) ; } else if ( ( event . getAction ( ) ) != ( Action . PHYSICAL ) ) { Util . Message ( jail . getSettings ( ) . getString ( MessagePreventedInteractionNoPenalty ) , event . getPlayer ( ) ) ; } event . setCancelled ( true ) ; return ; } } if ( ( event . getPlayer ( ) . getItemInHand ( ) ) != null ) { int id = event . getPlayer ( ) . getItemInHand ( ) . getTypeId ( ) ; if ( jail . getSettings ( ) . getList ( PreventInteractionItems ) . contains ( String . valueOf ( id ) ) ) { if ( ( ( ( event . getAction ( ) ) != ( Action . PHYSICAL ) ) && ( ( jail . getSettings ( ) . getInt ( InteractionPenalty ) ) > 0 ) ) && ( ( prisoner . getRemainingTime ( ) ) > 0 ) ) { Util . Message ( jail . getSettings ( ) . getString ( MessagePreventedInteractionPenalty ) , event . getPlayer ( ) ) ; prisoner . setRemainingTime ( ( ( prisoner . getRemainingTime ( ) ) + ( ( jail . getSettings ( ) . getInt ( InteractionPenalty ) ) * 6 ) ) ) ; InputOutput . UpdatePrisoner ( prisoner ) ; } else if ( ( event . getAction ( ) ) != ( Action . PHYSICAL ) ) { Util . Message ( jail . getSettings ( ) . getString ( MessagePreventedInteractionNoPenalty ) , event . getPlayer ( ) ) ; } event . setCancelled ( true ) ; return ; } } } } public void onPlayerRespawn ( PlayerRespawnEvent event ) { } }

Fix:
if ( ( prisoner != null ) && ( ( prisoner . getJail ( ) ) != null ) ) {