mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Guard against undefined sessions in multiplayer
This commit is contained in:
parent
1b5b3f7f88
commit
011b47a108
@ -23,6 +23,7 @@ module.exports = {
|
|||||||
if (existingSessionId) {
|
if (existingSessionId) {
|
||||||
connections.delete(opts.session)
|
connections.delete(opts.session)
|
||||||
const session = sessions.get(existingSessionId)
|
const session = sessions.get(existingSessionId)
|
||||||
|
if (session) {
|
||||||
session.active = false
|
session.active = false
|
||||||
session.idleTimeout = setTimeout(() => {
|
session.idleTimeout = setTimeout(() => {
|
||||||
sessions.delete(existingSessionId)
|
sessions.delete(existingSessionId)
|
||||||
@ -32,6 +33,7 @@ module.exports = {
|
|||||||
data: { session: existingSessionId }
|
data: { session: existingSessionId }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
runtime.events.on('comms:message:multiplayer/connect', (opts) => {
|
runtime.events.on('comms:message:multiplayer/connect', (opts) => {
|
||||||
let session
|
let session
|
||||||
|
Loading…
x
Reference in New Issue
Block a user