v3rpc: only fill lease grant header if no error

Was panicking under cluster fault injection.
This commit is contained in:
Anthony Romano 2016-04-27 16:28:40 -07:00
parent ca83793876
commit 06ea8aee11

View File

@ -38,6 +38,9 @@ func (ls *LeaseServer) LeaseGrant(ctx context.Context, cr *pb.LeaseGrantRequest)
if err == lease.ErrLeaseExists {
return nil, rpctypes.ErrLeaseExist
}
if err != nil {
return nil, err
}
ls.hdr.fill(resp.Header)
return resp, err
}