Bug#964867: crashes when clicking on something not a link in New Game menu

Judit Foglszinger urbec at riseup.net
Sat Jul 11 14:50:31 BST 2020


Package: monsterz
Version: 0.7.1-11+b1
Severity: minor

to reproduce:
New Game-> *click on something, that is not a link* -> *crashes*

For example I clicked into the upper left corner:

Traceback (most recent call last):
  File "/usr/share/games/monsterz/monsterz.py", line 2043, in <module>
    main()
  File "/usr/share/games/monsterz/monsterz.py", line 2038, in main
    monsterz.go()
  File "/usr/share/games/monsterz/monsterz.py", line 1288, in go
    iterator()
  File "/usr/share/games/monsterz/monsterz.py", line 1565, in iterate_new
    elif event.type == MOUSEBUTTONDOWN and narea >= 10:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'


A quick fix would be to check if narea is None.

--- monsterz.py	2020-07-11 20:26:48.000000000 +0700
+++ /tmp/monsterz.py	2020-07-11 20:25:58.314438447 +0700
@@ -1562,7 +1562,7 @@
                 system.play('whip')
                 self.status = STATUS_MENU
                 return
-            elif event.type == MOUSEBUTTONDOWN and narea >= 10:
+            elif event.type == MOUSEBUTTONDOWN and narea is not None and narea >= 10:
                 system.play('whip')
                 if narea == ACTION_MOREMONSTERZ:
                     if items < 8:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/pkg-games-devel/attachments/20200711/2d32769f/attachment.sig>


More information about the Pkg-games-devel mailing list