When ErroNotFound, return an new entity to avoid conversion from nil errors

This commit is contained in:
Deluan 2016-03-18 17:24:26 -04:00
parent aa6afdb976
commit 25d902c9d7
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ func (r *ledisRepository) readEntity(id string) (interface{}, error) {
return nil, err
}
if len(res[0]) == 0 {
return nil, domain.ErrNotFound
return entity, domain.ErrNotFound
}
err = r.toEntity(res, entity)
return entity, err