BaseCtx : Fix crash in getNetByAlias()

This commit is contained in:
Adrien Prost-Boucle 2024-10-01 10:04:49 +02:00 committed by myrtle
parent 9b51c6e337
commit cc04882b17

View File

@ -213,7 +213,9 @@ struct BaseCtx
NetInfo *getNetByAlias(IdString alias) const 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 // Intended to simplify Python API