From 71680e73290c8dc6d50442268a52d830e8e6cf3f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 8 Oct 2021 09:32:45 +0200 Subject: [PATCH] Fixed adding conversation with unknown peer --- nomadnet/Directory.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nomadnet/Directory.py b/nomadnet/Directory.py index f64b4f7..857f72b 100644 --- a/nomadnet/Directory.py +++ b/nomadnet/Directory.py @@ -146,10 +146,11 @@ class Directory: self.directory_entries[entry.source_hash] = entry identity = RNS.Identity.recall(entry.source_hash) - associated_node = RNS.Destination.hash_from_name_and_identity("nomadnetwork.node", identity) - if associated_node in self.directory_entries: - node_entry = self.directory_entries[associated_node] - node_entry.trust_level = entry.trust_level + if identity != None: + associated_node = RNS.Destination.hash_from_name_and_identity("nomadnetwork.node", identity) + if associated_node in self.directory_entries: + node_entry = self.directory_entries[associated_node] + node_entry.trust_level = entry.trust_level def forget(self, source_hash): if source_hash in self.directory_entries: