From c62c60441852ff6b33eb0216729d374892b946f2 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sun, 15 Nov 2015 13:16:09 +0000 Subject: [PATCH] [GTKUI] Fix unselect error with treeview selection returning None In standalone mode treeview.get_selection returns None resulting in an AttributeError for call to unselect_all. --- deluge/ui/gtkui/torrentview.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 88bbfc237..d84c10e41 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -349,7 +349,8 @@ class TorrentView(ListView, component.Component): def stop(self): """Stops the torrentview""" # We need to clear the liststore - self.treeview.get_selection().unselect_all() + if self.treeview.get_selection(): + self.treeview.get_selection().unselect_all() self.liststore.clear() self.prev_status = {} self.filter = None