Bug 1260127 - Today pane: changing the number of days in the "Upcoming" section can cause an error "soonHeader is null". r=MakeMyDay
authorDecathlon <bv1578@gmail.com>
Mon, 28 Mar 2016 16:45:23 +0200
changeset 24732 2b8ddf24b85ec9acbe3a6c0ed505b1910308fd12
parent 24731 bdb9854f10bfd4d742a177bcc4267c49799a93d3
child 24733 452569be7f752111e13aa60f07978024399c2276
push id1657
push userclokep@gmail.com
push dateMon, 06 Jun 2016 19:50:21 +0000
treeherdercomm-beta@9fac989284b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1260127
Bug 1260127 - Today pane: changing the number of days in the "Upcoming" section can cause an error "soonHeader is null". r=MakeMyDay MozReview-Commit-ID: h5tGfN3F4T
calendar/base/content/agenda-listbox.js
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -1033,25 +1033,27 @@ function agenda_calAdded(aCalendar) {
         this.agendaListbox.refreshCalendarQuery(null, null, aCalendar);
     }
 };
 
 agendaListbox.calendarObserver.onDefaultCalendarChanged = function(aCalendar) {
 };
 
 /**
- * Updates the "Soon" section of today pane when preference soondays changes
+ * Updates the "Upcoming" section of today pane when preference soondays changes
  **/
 agendaListbox.updateSoonSection =
 function updateSoonSection() {
-    let soonHeader = document.getElementById("nextweek-header");
     this.soon.duration = this.soonDays;
     this.soon.open = true;
-    soonHeader.setItem(this.soon, true);
-    agendaListbox.refreshPeriodDates(now());
+    let soonHeader = document.getElementById("nextweek-header");
+    if (soonHeader) {
+        soonHeader.setItem(this.soon, true);
+        agendaListbox.refreshPeriodDates(now());
+    }
 }
 
 /**
  * Updates the event considered "current". This goes through all "today" items
  * and sets the "current" attribute on all list items that are currently
  * occurring.
  *
  * @see scheduleNextCurrentEventUpdate