Skip to content

Commit 67fa739

Browse files
committed
Updated new Contact class to handle services=None from test_contact_tcp.py
1 parent d83b25e commit 67fa739

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/contacts/contact_tcp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def __init__(self, services):
1616
self.description = 'Accept beacons through a raw TCP socket'
1717
self.log = self.create_logger('contact_tcp')
1818
self.contact_svc = services.get('contact_svc')
19-
self.tcp_handler = TcpSessionHandler(services, self.log)
19+
# Ensure services is always a mapping to avoid AttributeError when tests pass None
20+
self.services = services or {}
21+
self.tcp_handler = TcpSessionHandler(self.services, self.log)
2022

2123
async def start(self):
2224
loop = asyncio.get_event_loop()

0 commit comments

Comments
 (0)