Skip to content

Commit

Permalink
[matter_yamltests] If the response is empty the parser fails to valid…
Browse files Browse the repository at this point in the history
…ate the response (#24749)
  • Loading branch information
vivien-apple authored and pull[bot] committed Oct 31, 2023
1 parent 088b06a commit d3eb5a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/py_matter_yamltests/matter_yamltests/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ def _response_values_validation(self, response, result):
received_value = response.get('value')
if not self.is_attribute:
expected_name = value.get('name')
if expected_name not in received_value:
if received_value is None or expected_name not in received_value:
result.error(check_type, error_name_does_not_exist.format(
name=expected_name))
continue
Expand Down Expand Up @@ -692,7 +692,7 @@ def _response_constraints_validation(self, response, result):
received_value = response.get('value')
if not self.is_attribute:
expected_name = value.get('name')
if expected_name not in received_value:
if received_value is None or expected_name not in received_value:
result.error(check_type, error_name_does_not_exist.format(
name=expected_name))
continue
Expand Down Expand Up @@ -720,7 +720,7 @@ def _maybe_save_as(self, response, result):
received_value = response.get('value')
if not self.is_attribute:
expected_name = value.get('name')
if expected_name not in received_value:
if received_value is None or expected_name not in received_value:
result.error(check_type, error_name_does_not_exist.format(
name=expected_name))
continue
Expand Down

0 comments on commit d3eb5a5

Please sign in to comment.