Bug 1365980 - Fix invitation printing. r=philipp a=philipp
authormakemyday@gmx-topmail.de
Sun, 21 May 2017 21:04:29 +0200
changeset 27863 02ee438e62f57d9dcaa8e93a10e3e43f8cc5e098
parent 27862 d513b033c0d0aa2a714bcf16a2aeeb3dfe057391
child 27864 b54caccab021789493a278b587a5ab1c11c4d079
child 27866 512cc214e120571e3d23b37ee69805f6efffdcc1
push idunknown
push userunknown
push dateunknown
reviewersphilipp, philipp
bugs1365980
Bug 1365980 - Fix invitation printing. r=philipp a=philipp
calendar/lightning/components/lightningTextCalendarConverter.js
--- a/calendar/lightning/components/lightningTextCalendarConverter.js
+++ b/calendar/lightning/components/lightningTextCalendarConverter.js
@@ -67,20 +67,22 @@ ltnMimeConverter.prototype = {
                 msgWindow = msgUrl.msgWindow;
                 itipItem.sender = msgUrl.mimeHeaders.extractHeader("From", false);
             } catch (exc) {
                 // msgWindow is optional in some scenarios
                 // (e.g. gloda in action, throws NS_ERROR_INVALID_POINTER then)
             }
         }
 
+        // msgOverlay needs to be defined irrespectively of the existance of msgWindow to not break
+        // printing of invitation emails
+        let dom = ltn.invitation.createInvitationOverlay(event, itipItem);
+        msgOverlay = cal.xml.serializeDOM(dom);
+
         if (msgWindow) {
-            let dom = ltn.invitation.createInvitationOverlay(event, itipItem);
-            msgOverlay = cal.xml.serializeDOM(dom);
-
             let sinkProps = msgWindow.msgHeaderSink.properties;
             sinkProps.setPropertyAsInterface("itipItem", itipItem);
             sinkProps.setPropertyAsAUTF8String("msgOverlay", msgOverlay);
 
             // Notify the observer that the itipItem is available
             Services.obs.notifyObservers(null, "onItipItemCreation", 0);
         }
         return msgOverlay;