aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/lb_policy/round_robin/round_robin.c
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2017-03-30 19:43:00 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2017-03-30 19:43:00 -0700
commit228a5142c198be0e29908776e57260ef661e3dc5 (patch)
tree12e0ae017c72cf99fd3437bf24bf9163c519e7cf /src/core/ext/lb_policy/round_robin/round_robin.c
parent24eab2a127531ce322027734839548aa4a0932b1 (diff)
Don't assert over invalid channel args
Diffstat (limited to 'src/core/ext/lb_policy/round_robin/round_robin.c')
-rw-r--r--src/core/ext/lb_policy/round_robin/round_robin.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/ext/lb_policy/round_robin/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c
index a62082a2ff..8665b5c6c8 100644
--- a/src/core/ext/lb_policy/round_robin/round_robin.c
+++ b/src/core/ext/lb_policy/round_robin/round_robin.c
@@ -691,7 +691,9 @@ static grpc_lb_policy *round_robin_create(grpc_exec_ctx *exec_ctx,
* addresses, since we don't know how to handle them. */
const grpc_arg *arg =
grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES);
- GPR_ASSERT(arg != NULL && arg->type == GRPC_ARG_POINTER);
+ if (arg == NULL || arg->type != GRPC_ARG_POINTER) {
+ return NULL;
+ }
grpc_lb_addresses *addresses = arg->value.pointer.p;
size_t num_addrs = 0;
for (size_t i = 0; i < addresses->num_addresses; i++) {