From 7919ebf9a8994d2c5c4f0479859966db6da28624 Mon Sep 17 00:00:00 2001 From: Paul Z Date: Sun, 27 Aug 2023 23:24:20 +0200 Subject: [PATCH] fix error on src not existing --- src/relation_set.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/relation_set.rs b/src/relation_set.rs index 217cd2e..c35ca8c 100644 --- a/src/relation_set.rs +++ b/src/relation_set.rs @@ -119,7 +119,11 @@ impl RelationSet { let src = src.into(); let dst = dst.into(); - let src = self.nodes.read().await.get(&src).unwrap().clone(); + let src = if let Some(src) = self.nodes.read().await.get(&src) { + src.clone() + } else { + return false; + }; let src_neighbors = src .edges_out