From 7597fd422d52421dbc424c83c0f8dc0204eff9f7 Mon Sep 17 00:00:00 2001 From: Dave Grijalva Date: Wed, 7 Jan 2015 09:52:08 -0800 Subject: [PATCH] added a test condition --- jwt_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jwt_test.go b/jwt_test.go index 7ab42e1..0eeee27 100644 --- a/jwt_test.go +++ b/jwt_test.go @@ -157,6 +157,10 @@ func TestParseRequest(t *testing.T) { r.Header.Set("Authorization", fmt.Sprintf("Bearer %v", data.tokenString)) token, err := jwt.ParseFromRequest(r, data.keyfunc) + if token == nil { + t.Errorf("[%v] Token was not found: %v", data.name, err) + continue + } if !reflect.DeepEqual(data.claims, token.Claims) { t.Errorf("[%v] Claims mismatch. Expecting: %v Got: %v", data.name, data.claims, token.Claims) }