Skip to content

Commit c70ef23

Browse files
committed
fix ISE when restoring files from trash
1 parent c9cf79a commit c70ef23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

finder/models/folder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def validate_constraints(self):
204204
msg = gettext("A parent folder can not become the descendant of a destination folder.")
205205
raise ValidationError(msg)
206206
parent = parent.parent
207-
if next(self.parent.listdir(name=self.name), None):
207+
if self.parent.listdir(name=self.name).exists():
208208
msg = gettext("Folder named “{name}” already exists in destination folder.")
209209
raise ValidationError(msg.format(name=self.name))
210210
if self.name in ['__root__', '__trash__']:

0 commit comments

Comments
 (0)