From 5e1e5f8961ae611b62b0d5c40ce90b5ad0cfb83b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 1 Mar 2020 10:01:15 +0000 Subject: [PATCH] Handle invalid ports --- utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index cd0665344..7381a988c 100644 --- a/utils.py +++ b/utils.py @@ -188,7 +188,10 @@ def getDomainFromActor(actor: str) -> (str,int): else: domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','') if ':' in domain: - port=int(domain.split(':')[1]) + portStr=domain.split(':')[1] + if not portStr.isdigit(): + return None,None + port=int(portStr) domain=domain.split(':')[0] return domain,port