From c61abf6aca6be646320bd39d1b8fd7cdf348e339 Mon Sep 17 00:00:00 2001 From: RoboMagus <68224306+RoboMagus@users.noreply.github.com> Date: Wed, 14 Sep 2022 15:01:28 +0200 Subject: [PATCH] null initialize total sensor for pulse counter (#3803) * null initialize total sensor. * pedantic styling fix Co-authored-by: Guillermo Ruffino Co-authored-by: Guillermo Ruffino --- esphome/components/pulse_counter/pulse_counter_sensor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/pulse_counter/pulse_counter_sensor.h b/esphome/components/pulse_counter/pulse_counter_sensor.h index d9be79e403..ef944f106f 100644 --- a/esphome/components/pulse_counter/pulse_counter_sensor.h +++ b/esphome/components/pulse_counter/pulse_counter_sensor.h @@ -81,7 +81,7 @@ class PulseCounterSensor : public sensor::Sensor, public PollingComponent { PulseCounterStorageBase &storage_; uint32_t last_time_{0}; uint32_t current_total_{0}; - sensor::Sensor *total_sensor_; + sensor::Sensor *total_sensor_{nullptr}; }; } // namespace pulse_counter