Commit 08f62057 authored by Matt Traudt's avatar Matt Traudt
Browse files

Avoid exception when we can't fetch an ed25519_master_key

parent 4851d077
......@@ -26,6 +26,8 @@ the exit position.
tried fixing something in this area with `88fae60bc` but neglected to
remember that `.join()` wants only string arguments and can't handle a `None`.
So fix that.
- Exception when failing to get a relay's `ed25519_master_key` from Tor and
trying to do `.rstrip()` on a None.
......@@ -85,7 +85,10 @@ class Relay:
# Even if this key is called master-key-ed25519 in dir-spec.txt,
# it seems that stem parses it as ed25519_master_key
return self._from_desc('ed25519_master_key').rstrip('=')
key = self._from_desc('ed25519_master_key')
if key is None:
return None
return key.rstrip('=')
def can_exit_to(self, host, port):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment