From ec18c6e42f2ffe3b342da2d524e87911e37c2a0f Mon Sep 17 00:00:00 2001 From: Rekby Date: Sun, 10 Apr 2016 16:06:49 +0300 Subject: [PATCH] Fix out of range --- acme/jws.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acme/jws.go b/acme/jws.go index ca950e0c..dbb32ccf 100644 --- a/acme/jws.go +++ b/acme/jws.go @@ -101,7 +101,9 @@ func (j *jws) Nonce() (string, error) { if err != nil { return nonce, err } - return "", errors.New("Can't get nonce") + if len(j.nonces) == 0 { + return "", errors.New("Can't get nonce") + } } nonce, j.nonces = j.nonces[len(j.nonces)-1], j.nonces[:len(j.nonces)-1]