Bug 1715345 - Do not attempt getSelection() if no contentWindow available when converting to event. r=darktrojan
authorLasana Murray <lasana@thunderbird.net>
Fri, 11 Jun 2021 20:05:37 -0400
changeset 32797 a294f959ab64d9a7f493754dda0bbd30edcb98d4
parent 32796 97a11bfda3c99a1e280eb9532d40bbe8bcda2f4e
child 32798 c5e77eb3677a3f790716cdda269fe8dabcbdb782
push id18868
push userthunderbird@calypsoblue.org
push dateSat, 12 Jun 2021 00:09:22 +0000
treeherdercomm-central@d265e97b8155 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1715345
Bug 1715345 - Do not attempt getSelection() if no contentWindow available when converting to event. r=darktrojan Differential Revision: https://phabricator.services.mozilla.com/D117217
calendar/base/content/calendar-extract.js
--- a/calendar/base/content/calendar-extract.js
+++ b/calendar/base/content/calendar-extract.js
@@ -115,17 +115,17 @@ var calendarExtract = {
     let item;
     item = isEvent ? new CalEvent() : new CalTodo();
     item.title = message.mime2DecodedSubject;
     item.calendar = getSelectedCalendar();
     item.setProperty("DESCRIPTION", content);
     item.setProperty("URL", `mid:${message.messageId}`);
     cal.dtz.setDefaultStartEndHour(item);
     cal.alarms.setDefaultValues(item);
-    let sel = getMessagePaneBrowser().contentWindow.getSelection();
+    let sel = getMessagePaneBrowser().contentWindow?.getSelection();
     // Thunderbird Conversations might be installed
     if (sel === null) {
       try {
         sel = document
           .getElementById("multimessage")
           .contentDocument.querySelector(".iframe-container iframe")
           .contentDocument.getSelection();
       } catch (ex) {