Skip to content

Commit

Permalink
Populate UseGoogleCalendar.ColourId if null, eg upon upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
phw198 committed Nov 28, 2020
1 parent 0ccc6a0 commit 7f3ff9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/OutlookGoogleCalendarSync/GoogleOgcs/EventColour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ public List<Palette> ActivePalette {
get {
List<Palette> activePalette = new List<Palette>();
if (Settings.Instance.UseGoogleCalendar == null) return activePalette;


if (Settings.Instance.UseGoogleCalendar.ColourId == null) {
List<GoogleCalendarListEntry> gCals = GoogleOgcs.Calendar.Instance.GetCalendars();
Settings.Instance.UseGoogleCalendar.ColourId = gCals.Find(c => c.Id == Settings.Instance.UseGoogleCalendar.Id).ColourId;
}

//Palette currentCal = calendarPalette.Find(p => p.Id == Settings.Instance.UseGoogleCalendar.ColourId);
Palette currentCal = null;
foreach (Palette cal in calendarPalette) {
Expand Down

0 comments on commit 7f3ff9d

Please sign in to comment.