Skip to content

Commit 92cb67d

Browse files
committed
Extra safety
1 parent 316c726 commit 92cb67d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scsocket.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ var SCSocket = function (id, server, socket) {
115115
self._onSCClose(disconnectData.code, disconnectData.data);
116116
} else {
117117
if (self._autoAckEvents[eventName]) {
118-
response.end(eventData.data);
118+
if (eventData && eventData.data !== undefined) {
119+
response.end(eventData.data);
120+
} else {
121+
response.end();
122+
}
119123
SCEmitter.prototype.emit.call(self, eventName, eventData);
120124
} else {
121125
SCEmitter.prototype.emit.call(self, eventName, eventData, response.callback.bind(response));

0 commit comments

Comments
 (0)