diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 4546851aec..0088e5c451 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -105,6 +105,7 @@ class ProtoVarInt { /// Parse a varint from buffer. consumed must be a valid pointer (not null). static optional parse(const uint8_t *buffer, uint32_t len, uint32_t *consumed) { + assert(consumed != nullptr); if (len == 0) return {};