From ebdeaa1a5731bb47d99eecce78380958fda8df6f Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Thu, 12 Jan 2017 16:43:11 -0700 Subject: [PATCH] locking/api: only decode lock list if status is OK --- locking/api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locking/api.go b/locking/api.go index 20dbde2c..39b312a3 100644 --- a/locking/api.go +++ b/locking/api.go @@ -183,7 +183,10 @@ func (c *lockClient) Search(remote string, searchReq *lockSearchRequest) (*lockL } locks := &lockList{} - err = lfsapi.DecodeJSON(res, locks) + if res.StatusCode == http.StatusOK { + err = lfsapi.DecodeJSON(res, locks) + } + return locks, res, err }