Fix null pointer dereference when no sensors are defined (fixes #37)

This commit is contained in:
Oxan van Leeuwen
2023-03-25 18:52:20 +01:00
parent a167bcdb66
commit e37d924e93

View File

@@ -41,12 +41,7 @@ void StreamServerComponent::setup() {
this->socket_->bind(reinterpret_cast<struct sockaddr *>(&bind_addr), bind_addrlen);
this->socket_->listen(8);
#ifdef USE_BINARY_SENSOR
this->connected_sensor_->publish_state(false);
#endif
#ifdef USE_SENSOR
this->connection_count_sensor_->publish_state(0);
#endif
this->publish_sensor();
}
void StreamServerComponent::loop() {