diff --git a/moto/mediaconnect/models.py b/moto/mediaconnect/models.py index c9e14e56b..e838849ab 100644 --- a/moto/mediaconnect/models.py +++ b/moto/mediaconnect/models.py @@ -97,7 +97,7 @@ class MediaConnectBackend(BaseBackend): for index, _source in enumerate(flow.sources): self._add_source_details(_source, flow_id, f"127.0.0.{index}") - for index, output in enumerate(flow.outputs): + for index, output in enumerate(flow.outputs or []): if output.get("protocol") in ["srt-listener", "zixi-pull"]: output["listenerAddress"] = f"{index}.0.0.0" diff --git a/tests/test_mediaconnect/test_mediaconnect.py b/tests/test_mediaconnect/test_mediaconnect.py index 073e3e04c..e9c72c802 100644 --- a/tests/test_mediaconnect/test_mediaconnect.py +++ b/tests/test_mediaconnect/test_mediaconnect.py @@ -108,6 +108,7 @@ def test_create_flow_alternative_succeeds(): "SourcePriority": {"PrimarySource": "Source-B"}, "State": "ENABLED", }, + outputs=None, ) response = client.create_flow(**channel_config)