From: Lennart Poettering Date: Fri, 12 Dec 2008 19:25:23 +0000 (+0100) Subject: avahi-discover crashes if row is unselected X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=17a87e365175dac3682735710522695b7e5a6bdc;p=catta avahi-discover crashes if row is unselected Quoting james_w: "I believe the cause of this was the a row was unselected, meaning that get_selection() returned None for iter, which then was used improperly in treemodel.get() The attached patch should prevent this from happening. Please consider applying it." Patch from james_w. Closes #226. --- diff --git a/avahi-python/avahi-discover/avahi-discover.in b/avahi-python/avahi-discover/avahi-discover.in index 229c7bd..be8c08b 100755 --- a/avahi-python/avahi-discover/avahi-discover.in +++ b/avahi-python/avahi-discover/avahi-discover.in @@ -61,7 +61,9 @@ class Main_window(SimpleGladeApp): def on_tree_view_cursor_changed(self, widget, *args): (model, iter) = widget.get_selection().get_selected() - (name,interface,protocol,stype,domain) = self.treemodel.get(iter,1,2,3,4,5) + stype = None + if iter is not None: + (name,interface,protocol,stype,domain) = self.treemodel.get(iter,1,2,3,4,5) if stype == None: self.info_label.set_markup("No service currently selected.") return