Skip to content

Commit c48f04c

Browse files
committed
fix(tui): guard PORT_SERVICE_MAP lookup against None port key
pyright reports dict.get(None, ...) where dict is typed dict[int, str].
1 parent ca8cc41 commit c48f04c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/presentation/tui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _selected_device_detail_text(self, device):
202202
lines.append("[bold]Open TCP Ports[/bold]")
203203
for entry in sorted(open_entries, key=lambda e: e.get("port", 0)):
204204
port = entry.get("port")
205-
svc = PORT_SERVICE_MAP.get(port, "")
205+
svc = PORT_SERVICE_MAP.get(port, "") if isinstance(port, int) else ""
206206
banner = entry.get("banner")
207207
rtt = entry.get("rtt_ms")
208208
if banner:

0 commit comments

Comments
 (0)