From b395f5c90aa06885aa9441217cc0abaaa53ccc11 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Sat, 5 Mar 2022 23:19:01 +0300 Subject: [PATCH] fix: handle the broken database gracefully --- org-journal-tags.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org-journal-tags.el b/org-journal-tags.el index 87b57c9..1112c29 100644 --- a/org-journal-tags.el +++ b/org-journal-tags.el @@ -247,7 +247,11 @@ The properties are: (with-temp-buffer (insert-file-contents org-journal-tags-db-file) (goto-char (point-min)) - (setf org-journal-tags-db (read (current-buffer)))))) + (condition-case err + (setf org-journal-tags-db (read (current-buffer))) + (error (progn + (message "Recreating the database because of an error") + (setf org-journal-tags-db (org-journal-tags-db--empty)))))))) (defun org-journal-tags-db-ensure () "Ensure that the database has been loaded."