locking/api: only decode lock list if status is OK

This commit is contained in:
Taylor Blau 2017-01-12 16:43:11 -07:00
parent b92cac52f5
commit ebdeaa1a57

@ -183,7 +183,10 @@ func (c *lockClient) Search(remote string, searchReq *lockSearchRequest) (*lockL
} }
locks := &lockList{} locks := &lockList{}
if res.StatusCode == http.StatusOK {
err = lfsapi.DecodeJSON(res, locks) err = lfsapi.DecodeJSON(res, locks)
}
return locks, res, err return locks, res, err
} }