fix: socket going away during sends

This commit is contained in:
cha0s 2019-05-13 21:20:35 -05:00
parent 057e5bc682
commit 2c29c606ee

View File

@ -203,6 +203,10 @@ export class Informed extends decorate(Trait) {
// Ship it!
for (let i = 0; i < packets.length; i++) {
const packet = packets[i];
// This can actually happen during a send. Yikes.
if (!this._socket) {
break;
}
this._socket.send(packet);
}
},