When a key is pressed that is not 'q' or an arrow key, the game crashes

Bug #631673 reported by Josh Brown
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snakes
Fix Released
Critical
Josh Brown

Bug Description

When a key is pressed that is not 'q' or an arrow key, the game ends with the following error message:

Traceback (most recent call last):
  File "./snakes", line 135, in <module>
    curses.wrapper(main)
  File "/usr/lib/python2.6/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "./snakes", line 127, in main
    else: snake.update(None)
  File "./snakes", line 70, in update
    self.body[0].update(direction)
  File "./snakes", line 58, in update
    if type(direction[0]) is int and type(direction[1]) is int:
TypeError: 'NoneType' object is unsubscriptable

Related branches

Revision history for this message
Josh Brown (joshbrown) wrote :

This is not only a high-priority bug in itself, but will also prevent the implementation of perpetual motion (bug #628215).

Changed in snakes-game:
importance: Undecided → Critical
milestone: none → 1.0
status: New → Triaged
Revision history for this message
Josh Brown (joshbrown) wrote :

 This bug is easy to fix by adding just one line of code.

Revision history for this message
Josh Brown (joshbrown) wrote :
Changed in snakes-game:
assignee: nobody → Josh Brown (joshbrown)
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.