summaryrefslogtreecommitdiffstats
path: root/avahi-python
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-12-12 20:25:23 +0100
committerLennart Poettering <lennart@poettering.net>2008-12-12 20:25:23 +0100
commit17a87e365175dac3682735710522695b7e5a6bdc (patch)
tree19f8a5c6184fc61acb0443e65cacb253a3f24b6b /avahi-python
parentf3f1b8bb63a574853e2fbcafe47b121da972ca23 (diff)
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.
Diffstat (limited to 'avahi-python')
-rwxr-xr-xavahi-python/avahi-discover/avahi-discover.in4
1 files changed, 3 insertions, 1 deletions
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("<i>No service currently selected.</i>")
return