Bug 1585237 - Follow-up: fix an error when the selected value isn't displayed. r=pmorris
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 09 Oct 2019 20:05:25 +1300
changeset 37116 f2acb164f729794d6eb401d2e281b4ac3ac7e2bc
parent 37115 abee555c45e1fd702eed02c034d7ba383774e6c2
child 37117 16e5783c0659a5552fc7c8555295e2326e519ad4
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewerspmorris
bugs1585237
Bug 1585237 - Follow-up: fix an error when the selected value isn't displayed. r=pmorris
calendar/base/content/widgets/calendar-minimonth.js
--- a/calendar/base/content/widgets/calendar-minimonth.js
+++ b/calendar/base/content/widgets/calendar-minimonth.js
@@ -584,17 +584,19 @@
         this.mSelected.removeAttribute("selected");
         this.mSelected = null;
       }
 
       if (!monthChanged && this.mDayMap) {
         let ymd =
           this.value.getFullYear() + "-" + this.value.getMonth() + "-" + this.value.getDate();
         this.mSelected = this.mDayMap[ymd];
-        this.mSelected.setAttribute("selected", "true");
+        if (this.mSelected) {
+          this.mSelected.setAttribute("selected", "true");
+        }
         return;
       }
 
       if (this.mToday) {
         this.mToday.removeAttribute("today");
         this.mToday = null;
       }