Fixed crash if chat poll returns no response

https://dev.doctormckay.com/topic/383-error-in-node-steamcommunity/
This commit is contained in:
Alexander Corn 2016-06-14 16:02:04 -04:00
parent 542eb8d47e
commit c1b04ee743

View File

@ -181,8 +181,8 @@ SteamCommunity.prototype._chatPoll = function() {
return;
}
if(body.error != 'OK') {
self.emit('debug', 'Error in chat poll: ' + body.error);
if(!body || body.error != 'OK') {
self.emit('debug', 'Error in chat poll: ' + (body && body.error ? body.error : "Malformed response"));
return;
}