get-user-password shouldn't assume the user exists

This commit is contained in:
Alex Shinn 2015-05-02 22:43:32 +09:00
parent c7d64a19c4
commit 366dbdb9dc

View file

@ -96,7 +96,7 @@
(define (get-user-password cfg email) (define (get-user-password cfg email)
(let* ((user-dir (static-local-path cfg (email->path email))) (let* ((user-dir (static-local-path cfg (email->path email)))
(key-file (make-path user-dir "pub-key")) (key-file (make-path user-dir "pub-key"))
(key (call-with-input-file key-file read))) (key (guard (exn (else #f)) (call-with-input-file key-file read))))
(and (pair? key) (assoc-get key 'password)))) (and (pair? key) (assoc-get key 'password))))
(define (package-dir email pkg) (define (package-dir email pkg)