From bc85b0948e7223676261dba0e50811e743495a9a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 Oct 2013 11:46:03 +0530 Subject: [PATCH] ... --- src/calibre/utils/filenames.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/calibre/utils/filenames.py b/src/calibre/utils/filenames.py index e998a11c7f..4bf1cffee3 100644 --- a/src/calibre/utils/filenames.py +++ b/src/calibre/utils/filenames.py @@ -352,12 +352,13 @@ class WindowsAtomicFolderMove(object): # in which case we use the same handle for both files fileid = name_to_fileid[x] found = False - for other in fileid_to_names[fileid]: - other = os.path.normcase(os.path.abspath(os.path.join(path, other))) - if other in self.handle_map: - self.handle_map[f] = self.handle_map[other] - found = True - break + if fileid is not None: + for other in fileid_to_names[fileid]: + other = os.path.normcase(os.path.abspath(os.path.join(path, other))) + if other in self.handle_map: + self.handle_map[f] = self.handle_map[other] + found = True + break if found: continue