Prevent crush in socketError during handshake

Can crush on line 377 otherwise