Răsfoiți Sursa

Ensure that the converse session is actually present (#2636)

* Ensure that the converse session is actually present before trying to get anything out of it

* Update changelog
The Stranjer 3 ani în urmă
părinte
comite
660d765c59
2 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 1 0
      CHANGES.md
  2. 1 1
      src/headless/plugins/smacks/utils.js

+ 1 - 0
CHANGES.md

@@ -8,6 +8,7 @@
 - #2633: Excessive logging of warning
 - #2634: Image previews not loading when not serving Converse locally
 - Bugfix: Don't show minimized chats when logged out
+- Bugfix: Ensure that the converse session is actually present before trying to get things from it
 
 ## 8.0.0 (2021-09-03)
 

+ 1 - 1
src/headless/plugins/smacks/utils.js

@@ -196,7 +196,7 @@ export async function enableStreamManagement () {
     smacks_handlers.push(conn.addHandler(stanzaHandler));
     smacks_handlers.push(conn.addHandler(sendAck, Strophe.NS.SM, 'r'));
     smacks_handlers.push(conn.addHandler(handleAck, Strophe.NS.SM, 'a'));
-    if (_converse.session.get('smacks_stream_id')) {
+    if (_converse.session && _converse.session.get('smacks_stream_id')) {
         await sendResumeStanza();
     } else {
         resetSessionData();