File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,14 @@ static esp_err_t app_attribute_update_cb(
29
29
uint32_t attribute_id, esp_matter_attr_val_t *val, void *priv_data)
30
30
{
31
31
esp_err_t err = ESP_OK;
32
+ MatterEndPoint *ep = (MatterEndPoint *) priv_data; // endpoint pointer to base class
33
+ if (ep == NULL ) {
34
+ return err;
35
+ }
32
36
switch (type) {
33
37
case PRE_UPDATE: // Callback before updating the value in the database
34
38
log_i (" Attribute update callback: PRE_UPDATE" );
35
- MatterEndPoint *ep = (MatterEndPoint *) priv_data; // endpoint pointer to base class
36
- if (ep != NULL ) {
37
- err = ep->attributeChangeCB (endpoint_id, cluster_id, attribute_id, val) ? ESP_OK : ESP_FAIL;
38
- }
39
+ err = ep->attributeChangeCB (endpoint_id, cluster_id, attribute_id, val) ? ESP_OK : ESP_FAIL;
39
40
break ;
40
41
case POST_UPDATE: // Callback after updating the value in the database
41
42
log_i (" Attribute update callback: POST_UPDATE" );
@@ -163,4 +164,4 @@ void ArduinoMatter::decommission() {
163
164
// Global Matter Object
164
165
ArduinoMatter Matter;
165
166
166
- #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */
167
+ #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */
You can’t perform that action at this time.
0 commit comments