Skip to content

Node.js based forum software built for the modern web

socket.handshake.address may not always be defined, thanks @psychobunny

Aziz Khoury32a5334402ab
diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js
index d9b9f7ab7c..b3d36e69b4 100644
--- a/src/socket.io/posts.js
+++ b/src/socket.io/posts.js
@@ -22,7 +22,7 @@ var async = require('async'),
referer = headers['referer'];
return {
- ip: headers['x-forwarded-for'] || socket.handshake.address.address,
+ ip: headers['x-forwarded-for'] || (socket.handshake.address || {}).address,
host: host,
protocol: headers['secure'] ? 'https' : 'http',
secure: !!headers['secure'],