From: Alexander Schmidt Date: Tue, 27 Oct 2020 00:08:24 +0000 (+0100) Subject: fixing null registry checks X-Git-Url: http://git.treefish.org/~alex/photosort.git/commitdiff_plain/418345c1f81d103e5ec091be0e211d8d4978c3c0 fixing null registry checks --- diff --git a/src/registry.py b/src/registry.py index 3d8cfd3..4eff031 100644 --- a/src/registry.py +++ b/src/registry.py @@ -15,27 +15,27 @@ class Registry: self._conn = sqlite3.connect(db_file, check_same_thread=False) def is_registered(self, name): - if not db_file: return False + if not self._conn: return False c = self._conn.cursor() c.execute("SELECT COUNT(*) FROM cache WHERE name=?", (name,)) return c.fetchone() != None def clean(self): - if not db_file: return + if not self._conn: return c = self._conn.cursor() c.execute("DELETE FROM cache WHERE access_time