After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652454 - alacarte crashed with TypeError in on_menu_tree_cursor_changed(): iter should be a GtkTreeIter
alacarte crashed with TypeError in on_menu_tree_cursor_changed(): iter should...
Status: RESOLVED FIXED
Product: alacarte
Classification: Applications
Component: general
0.13.x
Other Linux
: Normal critical
: ---
Assigned To: Alacarte Maintainer(s)
Alacarte Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-06-13 13:20 UTC by Pedro Villavicencio
Modified: 2011-08-23 19:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use gtk.SELECTION_BROWSE mode for menu_tree (1.04 KB, patch)
2011-08-06 23:27 UTC, Alexandre Rostovtsev
none Details | Review
Fix crash in on_menu_tree_cursor_changed() (1.23 KB, patch)
2011-08-23 19:17 UTC, Olav Vitters
committed Details | Review

Description Pedro Villavicencio 2011-06-13 13:20:08 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/alacarte/+bug/709365

"Just launched the application from the console and got this error.

I haven't found a pattern to reproduce it."

Traceback:
 Traceback (most recent call last):
  • File "/usr/share/alacarte/Alacarte/MainWindow.py", line 388 in on_menu_tree_cursor_changed
    menu_path = menus.get_path(iter)  TypeError: iter should be a GtkTreeIter

Comment 1 Alexandre Rostovtsev 2011-08-06 23:27:25 UTC
Created attachment 193363 [details] [review]
Use gtk.SELECTION_BROWSE mode for menu_tree

This bug is caused by the fact that treeview.get_selection().get_selected() can return a None iter when the selection has no rows (e.g. if the user has deselected a row by Ctrl-clicking on it).

The solution is to use gtk.SELECTION_BROWSE selection mode; it will ensure that one row is always selected and valid iters are returned from the selection's get_selected().
Comment 2 Olav Vitters 2011-08-23 19:17:06 UTC
The following fix has been pushed:
1646c19 Fix crash in on_menu_tree_cursor_changed()
Comment 3 Olav Vitters 2011-08-23 19:17:10 UTC
Created attachment 194525 [details] [review]
Fix crash in on_menu_tree_cursor_changed()

This bug is caused by the fact that
treeview.get_selection().get_selected() can return a None iter when the
selection has no rows (e.g. if the user has deselected a row by
Ctrl-clicking on it).

The solution is to use gtk.SELECTION_BROWSE selection mode; it will
ensure that one row is always selected and valid iters are returned from
the selection's get_selected().