mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
ADE7953: Fix dereferencing of a null pointer (#1086)
* ADE7953: Fix dereferencing of a null pointer The ade7953 driver dereferences a null pointer, when not all of its sensors are used. This gives an exception like: Fatal exception:29 flag:2 (EXCEPTION) epc1:0x4020c241 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000018 depc:0x00000000 * Fix formatting Co-authored-by: olg <x>
This commit is contained in:
parent
9632ac0e02
commit
4fb750de43
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ void ADE7953::dump_config() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ADE_PUBLISH_(name, factor) \
|
#define ADE_PUBLISH_(name, factor) \
|
||||||
if (name) { \
|
if (name && this->name##_sensor_) { \
|
||||||
float value = *name / factor; \
|
float value = *name / factor; \
|
||||||
this->name##_sensor_->publish_state(value); \
|
this->name##_sensor_->publish_state(value); \
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue