diff --git a/dist/libsignal-protocol.js b/dist/libsignal-protocol.js index da7fae6..01a4880 100644 --- a/dist/libsignal-protocol.js +++ b/dist/libsignal-protocol.js @@ -35624,7 +35624,8 @@ Internal.SessionRecord = function() { }); }, haveOpenSession: function() { - return this.getOpenSession() !== undefined; + var openSession = this.getOpenSession(); + return (!!openSession && !!openSession.registrationId); }, getSessionByBaseKey: function(baseKey) { diff --git a/src/SessionRecord.js b/src/SessionRecord.js index 82282bf..2792528 100644 --- a/src/SessionRecord.js +++ b/src/SessionRecord.js @@ -125,7 +125,8 @@ Internal.SessionRecord = function() { }); }, haveOpenSession: function() { - return this.getOpenSession() !== undefined; + var openSession = this.getOpenSession(); + return (!!openSession && !!openSession.registrationId); }, getSessionByBaseKey: function(baseKey) {