@alex-bukach after clicking the "leave room" button as an anonymous client, the chat crashes and I get the error
[19 Jun 09:37:37 - Info: Saved chat duration into stats.
2017-06-19T09:37:39.068Z - info: Regular user disconnected. 2050cc9c-05fb-4bab-9ca1-8a0e991229c6
2017-06-19T09:37:39.069Z - info: User logout: No valid reference to client.
2017-06-19T09:37:39.069Z - info: User logout: Chat duration (minutes): 1
/home/demo/opeka/nodejs/lib/opeka.js:1256
opeka.statistics.saveChatDuration(removedUser.stats_id, chatDuration);
^
TypeError: Cannot read property 'stats_id' of null
at Server.self.removeUserFromRoom (/home/demo/opeka/nodejs/lib/opeka.js:1256:52)
at /home/demo/opeka/nodejs/lib/opeka.js:1175:14
at Array.forEach (native)
at /home/demo/opeka/nodejs/lib/opeka.js:1159:37
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)]
The chat duration is saved correctly, but it seems that the method is called twice, and the second time the removedUser isn't initialized.
@alex-bukach after clicking the "leave room" button as an anonymous client, the chat crashes and I get the error
The chat duration is saved correctly, but it seems that the method is called twice, and the second time the
removedUser
isn't initialized.