Risk Level
HIGH
File
core/src/exchanges/probable/websocket.ts
Findings
- Line 77:
this.orderBookResolvers.get(tokenId)!.push({ resolve, reject }); — assumes tokenId is already a key in orderBookResolvers. If absent, .push() is invoked on undefined.
What Happens When It's Wrong
TypeError: Cannot read properties of undefined (reading 'push') — the pending watchOrderBook promise leaks silently; downstream callers hang until watch timeout.
Suggested Fix
if (!this.orderBookResolvers.has(tokenId)) this.orderBookResolvers.set(tokenId, []);
this.orderBookResolvers.get(tokenId)!.push({ resolve, reject });
Found by automated non-null assertion audit
Risk Level
HIGH
File
core/src/exchanges/probable/websocket.tsFindings
this.orderBookResolvers.get(tokenId)!.push({ resolve, reject });— assumestokenIdis already a key inorderBookResolvers. If absent,.push()is invoked onundefined.What Happens When It's Wrong
TypeError: Cannot read properties of undefined (reading 'push')— the pendingwatchOrderBookpromise leaks silently; downstream callers hang until watch timeout.Suggested Fix
Found by automated non-null assertion audit