From 61bd8aa15405d5582d67e01d3e8cdde634056344 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 2 Jan 2013 22:34:00 +0000 Subject: [PATCH] Fix Gtk addtorrentdialog parent None error for single file torrents --- deluge/ui/gtkui/addtorrentdialog.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index 976f95eaa..b3f20109d 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -884,9 +884,10 @@ class AddTorrentDialog(component.Component): parent = self.files_treestore.iter_parent(itr) file_path = os.path.join(self.get_file_path(parent), new_text) # Don't rename if filename exists - for row in self.files_treestore[parent].iterchildren(): - if new_text == row[1]: - return + if parent: + for row in self.files_treestore[parent].iterchildren(): + if new_text == row[1]: + return if os.path.sep in new_text: # There are folders in this path, so we need to create them # and then move the file iter to top