From f8a7e8a678c2e379aff91596a05a49678a3ebd84 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 21 Jun 2024 21:20:56 +0200 Subject: [PATCH] forge--format-topic-milestone: Ignore unknown milestones If a topic was fetched individually, without fetching all data for its repository, then we might know nothing about its milestone, except for the id. Ignore it in that case. --- lisp/forge-topic.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/forge-topic.el b/lisp/forge-topic.el index 316e386c..df3f3977 100644 --- a/lisp/forge-topic.el +++ b/lisp/forge-topic.el @@ -809,10 +809,12 @@ can be selected from the start." (`(forge-pullreq rejected) 'forge-pullreq-rejected))))))) (defun forge--format-topic-milestone (topic) - (and-let* ((id (oref topic milestone))) - (magit--propertize-face - (caar (forge-sql [:select [title] :from milestone :where (= id $s1)] id)) - 'forge-topic-label))) + (and-let* ((id (oref topic milestone)) + (str (caar (forge-sql [:select [title] + :from milestone + :where (= id $s1)] + id)))) + (magit--propertize-face str 'forge-topic-label))) (defun forge--format-topic-labels (topic) (and-let* ((labels (closql--iref topic 'labels)))