diff --git a/nimble/host/mesh/src/access.c b/nimble/host/mesh/src/access.c index 85717aa51..79f4be7b4 100644 --- a/nimble/host/mesh/src/access.c +++ b/nimble/host/mesh/src/access.c @@ -328,7 +328,7 @@ int bt_mesh_comp_register(const struct bt_mesh_comp *comp) int err; /* There must be at least one element */ - if (!comp->elem_count) { + if (!comp || !comp->elem_count) { return -EINVAL; }