From 3a059d15b5afaed29629cbf640d6b50570ab8902 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 14 Jan 2018 17:47:21 +1000 Subject: [PATCH] check prefs21.db integrity otherwise some corruption errors only become apparent when trying to load an individual profile --- aqt/profiles.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aqt/profiles.py b/aqt/profiles.py index 53cfd2628..4e622d2fa 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -307,6 +307,7 @@ Anki's prefs21.db file was corrupt and has been recreated. If you were using mul profiles, please add them back using the same names to recover your cards.""") try: self.db = DB(path) + assert self.db.scalar("pragma integrity_check") == "ok" self.db.execute(""" create table if not exists profiles (name text primary key, data text not null);""")