diff options
author | Mathieu Othacehe <othacehe@gnu.org> | 2020-07-26 17:28:03 +0200 |
---|---|---|
committer | Mathieu Othacehe <othacehe@gnu.org> | 2020-07-26 17:28:03 +0200 |
commit | f71f026a41d8e68e4a7f11ef6e708964594a599c (patch) | |
tree | a5f7f0372c2ef60c38acd6ee43460e424874c821 | |
parent | 17395e85d2793ec4cb47e53bcbdb5b06187147bd (diff) | |
download | cuirass-f71f026a41d8e68e4a7f11ef6e708964594a599c.tar cuirass-f71f026a41d8e68e4a7f11ef6e708964594a599c.tar.gz |
templates: Handle missing input case.
It happens that some left-over checkout entries refer to removed inputs. In
that case, input will be #f, causing commit-hyperlink to fail with the
following error message:
In cuirass/http.scm:
475:25 9 (url-handler _ _)
193:3 8 (evaluation-html-page ((#:id . 5103) (# . 0) (# . 39) ?) ?)
In cuirass/templates.scm:
612:14 7 (evaluation-build-table _ #:checkouts _ #:inputs _ # _ # ?)
In srfi/srfi-1.scm:
586:17 6 (map1 (((#:commit . "3a3e9f2bb586e79a7931163f0191d?") ?)))
In cuirass/templates.scm:
621:39 5 (_ _)
584:15 4 (commit-hyperlink #f "3a3e9f2bb586e79a7931163f0191df615?")
In web/uri.scm:
308:23 3 (string->uri _)
278:14 2 (string->uri-reference _)
In unknown file:
1 (regexp-exec #<regexp 7f3a76c05980> #f #<undefined> #<u?>)
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)
In procedure regexp-exec: Wrong type argument in position 2 (expecting string): #f
* src/cuirass/templates.scm (evaluation-build-table): Do not call
"commit-hyperlink" if the matching input could not be found.
-rw-r--r-- | src/cuirass/templates.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm index 58ef142..170cc84 100644 --- a/src/cuirass/templates.scm +++ b/src/cuirass/templates.scm @@ -617,8 +617,12 @@ evaluation." inputs)) (url (assq-ref input #:url)) (commit (assq-ref checkout #:commit))) - `(tr (td ,url) - (td (code ,(commit-hyperlink url commit)))))) + ;; Some checkout entries may refer to removed + ;; inputs. + (if input + `(tr (td ,url) + (td (code ,(commit-hyperlink url commit)))) + '()))) checkouts))) (p (@ (class "lead")) |