Bug 1792525 - Prevent exception "userId is undefined" for OpenPGP messages. r=mkmelin
authorKai Engert <kaie@kuix.de>
Thu, 29 Sep 2022 08:25:43 +0000
changeset 36829 cbf6da84035888ea4ea00e0d163fe8ea785e82a9
parent 36828 0bd0cd44c871acbab9caea4636c2d2ad319eb696
child 36830 30cbbf5e4bdd72e498308c6c7df5b2267c45a68b
push id20340
push usergeoff@darktrojan.net
push dateThu, 29 Sep 2022 22:33:58 +0000
treeherdercomm-central@30cbbf5e4bdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1792525
Bug 1792525 - Prevent exception "userId is undefined" for OpenPGP messages. r=mkmelin Differential Revision: https://phabricator.services.mozilla.com/D158187
mail/extensions/openpgp/content/ui/enigmailMsgHdrViewOverlay.js
--- a/mail/extensions/openpgp/content/ui/enigmailMsgHdrViewOverlay.js
+++ b/mail/extensions/openpgp/content/ui/enigmailMsgHdrViewOverlay.js
@@ -201,17 +201,17 @@ Enigmail.hdrView = {
     var replaceUid = null;
     if (keyId && gFolderDisplay.selectedMessage) {
       replaceUid = EnigmailMsgRead.matchUidToSender(
         keyId,
         gFolderDisplay.selectedMessage.author
       );
     }
 
-    if (!replaceUid) {
+    if (!replaceUid && userId) {
       replaceUid = userId.replace(/\n.*$/gm, "");
     }
 
     if (
       Enigmail.msg.savedHeaders &&
       "x-pgp-encoding-format" in Enigmail.msg.savedHeaders &&
       Enigmail.msg.savedHeaders["x-pgp-encoding-format"].search(
         /partitioned/i