File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 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(
2929 uint32_t attribute_id, esp_matter_attr_val_t *val, void *priv_data)
3030{
3131 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+ }
3236 switch (type) {
3337 case PRE_UPDATE: // Callback before updating the value in the database
3438 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;
3940 break ;
4041 case POST_UPDATE: // Callback after updating the value in the database
4142 log_i (" Attribute update callback: POST_UPDATE" );
@@ -163,4 +164,4 @@ void ArduinoMatter::decommission() {
163164// Global Matter Object
164165ArduinoMatter Matter;
165166
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