From 3914742637eaf58c686dec3d01e8c9d1e9319659 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Tue, 2 Aug 2022 23:22:33 +0300 Subject: [PATCH] fix: null index in org-journal-tags--transient-switches --- org-journal-tags.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-journal-tags.el b/org-journal-tags.el index 764be78..3d21ee3 100644 --- a/org-journal-tags.el +++ b/org-journal-tags.el @@ -2637,7 +2637,8 @@ are as follows: OBJ is an instance of the `org-journal-tags--transient-switches' class." (let ((choices (oref obj choices))) - (let ((idx (cl-position (oref obj value) choices))) + (let ((idx (or (cl-position (oref obj value) choices) + -1))) (nth (% (1+ idx) (length choices)) choices)))) (cl-defmethod transient-format-value ((obj org-journal-tags--transient-switches))