From 5b61db7d0adc264fd82af8f462d72cf0d1f15e58 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Fri, 20 Jun 2014 19:41:56 -0500 Subject: [PATCH] make sure unused media exist before deleting them --- aqt/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aqt/main.py b/aqt/main.py index 0e27b1271..7e8836510 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -982,7 +982,8 @@ will be lost. Continue?""")) mdir = self.col.media.dir() for f in unused: path = os.path.join(mdir, f) - send2trash(path) + if os.path.exists(path): + send2trash(path) tooltip(_("Deleted.")) diag.close()