refactor: reject request if swarmEvents entry is missing
This commit is contained in:
parent
0ed4449161
commit
cabbfe343d
|
@ -440,7 +440,8 @@ async function handleListenConnections(aq: ActiveQuery) {
|
||||||
const swarmEvent = swarmEvents.get(swarmId as number)?.events;
|
const swarmEvent = swarmEvents.get(swarmId as number)?.events;
|
||||||
|
|
||||||
if (!swarmEvent) {
|
if (!swarmEvent) {
|
||||||
logErr("swarm event object is missing");
|
aq.reject("swarm event object is missing");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
swarmEvent?.on("connection", listener);
|
swarmEvent?.on("connection", listener);
|
||||||
|
|
Loading…
Reference in New Issue