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,
}, largeMsgGRPCCallOpts...)
if err != nil {
return reply.Keys, err
return []string{}, err
}
if reply.Err != "" {
return reply.Keys, errors.New(reply.Err)