]> jfr.im git - irc/freenode/jbnc.git/commitdiff
Update of gone with error .end();
authorMadriix <redacted>
Tue, 28 Jul 2020 10:05:52 +0000 (12:05 +0200)
committerGitHub <redacted>
Tue, 28 Jul 2020 10:05:52 +0000 (12:05 +0200)
Example error :

            connections[this.hash].gone=setTimeout(function(x){connections[x].end(); delete connections[x]; },BOUNCER_TIMEOUT*1000,this.hash);
                                                                              ^

TypeError: Cannot read property 'end' of undefined

bouncer.js

index 62aebede6346c61151e73c3ecd01803e94ee990c..97cae08e052333ad003e9e7c4a77cd466a3c2803 100644 (file)
@@ -561,7 +561,7 @@ server = doServer(tlsOptions,function(socket) {
           connections[this.hash].connected=false;
           connections[this.hash].write("AWAY :jbnc\n");
           if(BOUNCER_TIMEOUT!=0 && BOUNCER_TIMEOUT!=null) {
-            connections[this.hash].gone=setTimeout(function(x){connections[x].end();delete connections[x];},BOUNCER_TIMEOUT*1000,this.hash);
+            connections[this.hash].gone=setTimeout(function(x){try{connections[x].end();}catch(e){} try{delete connections[x];}catch(e){} },BOUNCER_TIMEOUT*1000,this.hash);
           }
         }
       }