Bug 1300849 - "Error shown when opening New Event / New Task dialog [TypeError: completedCommand is null]" [r=philipp]
authorMarkus Adrario <:Taraman>
Fri, 28 Oct 2016 00:19:00 +0200
changeset 20696 8898cabfdac3e4744a8aeca8b82bc879f701dbde
parent 20695 e4ba6d64af29278d6cc17a47090fc26ef5b9c7b0
child 20697 d2c25fee0909d3f8122a97688e390915961029f2
push id12524
push userMozilla@Adrario.de
push dateSun, 13 Nov 2016 18:41:25 +0000
treeherdercomm-central@8898cabfdac3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs1300849
Bug 1300849 - "Error shown when opening New Event / New Task dialog [TypeError: completedCommand is null]" [r=philipp]
calendar/lightning/content/lightning-item-panel.js
--- a/calendar/lightning/content/lightning-item-panel.js
+++ b/calendar/lightning/content/lightning-item-panel.js
@@ -761,20 +761,22 @@ function editToDoStatus(aPercentComplete
  * Check or uncheck the "Mark updated" menu item in "Events and Tasks"
  * menu based on the percent complete value. (The percent complete menu
  * items are updated by changeMenuByPropertyName in calendar-menus.xml)
  *
  * @param {Object} aArg                 Container
  * @param {short} aArg.percentComplete  The percent complete value
  */
 function updateMarkCompletedMenuItem(aArg) {
-    // Command only exists for tab case, function not called for dialog windows.
-    let completedCommand = document.getElementById("calendar_toggle_completed_command");
-    let isCompleted = aArg.percentComplete == 100;
-    completedCommand.setAttribute("checked", isCompleted);
+    // Command only for tab case, function only to be executed in dialog windows.
+    if (gTabmail) {
+        let completedCommand = document.getElementById("calendar_toggle_completed_command");
+        let isCompleted = aArg.percentComplete == 100;
+        completedCommand.setAttribute("checked", isCompleted);
+    }
 }
 
 /**
  * Postpone the task's start date/time and due date/time. ISO 8601
  * format: "PT1H", "P1D", and "P1W" are 1 hour, 1 day, and 1 week. (We
  * use this format intentionally instead of a calIDuration object because
  * those objects cannot be serialized for message passing with iframes.)
  *