From d9e61450344c62667631a3c4aff83b492a8d5d6d Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 16 Sep 2024 18:20:53 +0200 Subject: [PATCH] Raise exception when SINGLE destination is created without identity --- RNS/Destination.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RNS/Destination.py b/RNS/Destination.py index f0dd761..bca8f35 100755 --- a/RNS/Destination.py +++ b/RNS/Destination.py @@ -167,6 +167,9 @@ class Destination: identity = RNS.Identity() aspects = aspects+(identity.hexhash,) + if identity == None and direction == Destination.OUT and self.type != Destination.PLAIN: + raise ValueError("Can't create outbound SINGLE destination without an identity") + if identity != None and self.type == Destination.PLAIN: raise TypeError("Selected destination type PLAIN cannot hold an identity")