fixed NullPointerExceptions when clicking empty square or when removing a piece when no piece is selected in the panel