Avoid crashing when no compare arguments are provided

This commit is contained in:
Christopher Baines 2020-11-21 16:49:58 +00:00
parent 3e15900c56
commit c751031a26

View file

@ -182,14 +182,16 @@
(($ <invalid-query-parameter> value) (($ <invalid-query-parameter> value)
(with-thread-postgresql-connection (with-thread-postgresql-connection
(lambda (conn) (lambda (conn)
(select-job-for-commit conn value)))) (and (string? value)
(select-job-for-commit conn value)))))
(_ #f))) (_ #f)))
(target-job (target-job
(match (assq-ref query-parameters 'target_commit) (match (assq-ref query-parameters 'target_commit)
(($ <invalid-query-parameter> value) (($ <invalid-query-parameter> value)
(with-thread-postgresql-connection (with-thread-postgresql-connection
(lambda (conn) (lambda (conn)
(select-job-for-commit conn value)))) (and (string? value)
(select-job-for-commit conn value)))))
(_ #f)))) (_ #f))))
(case (most-appropriate-mime-type (case (most-appropriate-mime-type
'(application/json text/html) '(application/json text/html)