From cc04882b172c76ff4b1216ae97030df6c7c8f457 Mon Sep 17 00:00:00 2001 From: Adrien Prost-Boucle Date: Tue, 1 Oct 2024 10:04:49 +0200 Subject: [PATCH] BaseCtx : Fix crash in getNetByAlias() --- common/kernel/basectx.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/kernel/basectx.h b/common/kernel/basectx.h index c8791a2b..7ff18228 100644 --- a/common/kernel/basectx.h +++ b/common/kernel/basectx.h @@ -213,7 +213,9 @@ struct BaseCtx NetInfo *getNetByAlias(IdString alias) const { - return nets.count(alias) ? nets.at(alias).get() : nets.at(net_aliases.at(alias)).get(); + if(nets.count(alias) > 0) return nets.at(alias).get(); + if(net_aliases.count(alias) == 0) return nullptr; + return nets.at(net_aliases.at(alias)).get(); } // Intended to simplify Python API