Skip to content

Commit 808fa85

Browse files
committed
Fixes #91: Handle NoneTypes in TXWorker.send_data()
1 parent 60a37b9 commit 808fa85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pytak/classes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ async def handle_data(self, data: bytes) -> None:
152152

153153
async def send_data(self, data: bytes) -> None:
154154
"""Send Data using the appropriate Protocol method."""
155+
if data is None:
156+
self._logger.warning("send_data called with None data, skipping send.")
157+
return
158+
155159
if self.use_protobuf:
156160
host, _ = pytak.parse_url(self.config.get("COT_URL", pytak.DEFAULT_COT_URL))
157161
is_multicast: bool = False

0 commit comments

Comments
 (0)