From f62c31fd447940cfb1705297631efebdad6ab626 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 6 Oct 2012 09:49:45 +0530 Subject: [PATCH] Fix #1062486 (Unhandled exception configuring MTP device) --- src/calibre/gui2/device_drivers/mtp_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/device_drivers/mtp_config.py b/src/calibre/gui2/device_drivers/mtp_config.py index dbb31a3e3d..5ab1dd692e 100644 --- a/src/calibre/gui2/device_drivers/mtp_config.py +++ b/src/calibre/gui2/device_drivers/mtp_config.py @@ -146,7 +146,7 @@ class SendToConfig(QWidget): # {{{ def browse(self): b = Browser(self.device.filesystem_cache, show_files=False, parent=self) - if b.exec_() == b.Accepted: + if b.exec_() == b.Accepted and b.current_item is not None: sid, path = b.current_item self.t.setText('/'.join(path[1:])) @@ -250,7 +250,7 @@ class Rule(QWidget): def browse(self): b = Browser(self.device.filesystem_cache, show_files=False, parent=self) - if b.exec_() == b.Accepted: + if b.exec_() == b.Accepted and b.current_item is not None: sid, path = b.current_item self.folder.setText('/'.join(path[1:]))