Mercurial > prosody-hg
comparison core/sessionmanager.lua @ 10372:5482f21a18a2
core.sessionmanager: Fix traceback from passing nil to resourceprep
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 02 Nov 2019 13:24:33 +0100 |
| parents | 63f87211fcdd |
| children | 04c4750ff8d2 |
comparison
equal
deleted
inserted
replaced
| 10371:228338120009 | 10372:5482f21a18a2 |
|---|---|
| 148 else | 148 else |
| 149 -- In case a plugin wants to poke at it | 149 -- In case a plugin wants to poke at it |
| 150 resource = event_payload.resource; | 150 resource = event_payload.resource; |
| 151 end | 151 end |
| 152 | 152 |
| 153 resource = resourceprep(resource); | 153 resource = resourceprep(resource or ""); |
| 154 resource = resource ~= "" and resource or generate_identifier(); | 154 resource = resource ~= "" and resource or generate_identifier(); |
| 155 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing | 155 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing |
| 156 | 156 |
| 157 if not hosts[session.host].sessions[session.username] then | 157 if not hosts[session.host].sessions[session.username] then |
| 158 local sessions = { sessions = {} }; | 158 local sessions = { sessions = {} }; |
