plugin/grpc: Fix a panic when a transport error occurs during a list (#4244)

This commit is contained in:
Brian Kassouf
2018-04-03 05:00:04 -07:00
committed by Jeff Mitchell
parent 7c06e9610f
commit a4fc5a40cd

View File

@@ -27,7 +27,7 @@ func (s *GRPCStorageClient) List(ctx context.Context, prefix string) ([]string,
Prefix: prefix, Prefix: prefix,
}, largeMsgGRPCCallOpts...) }, largeMsgGRPCCallOpts...)
if err != nil { if err != nil {
return reply.Keys, err return []string{}, err
} }
if reply.Err != "" { if reply.Err != "" {
return reply.Keys, errors.New(reply.Err) return reply.Keys, errors.New(reply.Err)