Mercurial > prosody-hg
comparison plugins/mod_smacks.lua @ 13573:9277fc78fe39
mod_smacks: Fix previous commit for case of no session found
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 19 Nov 2024 00:57:24 +0100 |
| parents | d9965707f7dc |
| children | 5d8fc1c4eb7c |
comparison
equal
deleted
inserted
replaced
| 13572:d9965707f7dc | 13573:9277fc78fe39 |
|---|---|
| 585 return nil, enable_errors.new("already_bound"); | 585 return nil, enable_errors.new("already_bound"); |
| 586 end | 586 end |
| 587 | 587 |
| 588 local id = stanza.attr.previd; | 588 local id = stanza.attr.previd; |
| 589 local original_session = session_registry[registry_key(session, id)]; | 589 local original_session = session_registry[registry_key(session, id)]; |
| 590 if original_session.destroyed then | 590 if original_session and original_session.destroyed then |
| 591 original_session.log("error", "Tried to resume a destroyed session. This should not happen! %s", debug.traceback()); | 591 original_session.log("error", "Tried to resume a destroyed session. This should not happen! %s", debug.traceback()); |
| 592 session_registry[registry_key(session, id)] = nil; | 592 session_registry[registry_key(session, id)] = nil; |
| 593 original_session = nil; | 593 original_session = nil; |
| 594 end | 594 end |
| 595 if not original_session then | 595 if not original_session then |
