Commit 5cb65d84 authored by JC Brand's avatar JC Brand

Bugfix. Don't assume OMEMO store is always there

parent 5ea7a4d1
......@@ -79,7 +79,8 @@ function getEncryptionAttributes (stanza, original_stanza, attrs, chatbox, _conv
if (!encrypted || !_converse.config.get('trusted')) {
return attrs;
}
const key = sizzle(`key[rid="${_converse.omemo_store.get('device_id')}"]`, encrypted).pop();
const device_id = _converse.omemo_store?.get('device_id');
const key = device_id && sizzle(`key[rid="${device_id}"]`, encrypted).pop();
if (key) {
const header = encrypted.querySelector('header');
attrs['is_encrypted'] = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment