Skip to content

Commit

Permalink
Fix crash in EventScheduler when number of monitors exceeds length of…
Browse files Browse the repository at this point in the history
… activeThemes
  • Loading branch information
t1m0thyj committed Aug 22, 2024
1 parent bf7a87f commit b1f0fc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EventScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinDynamicDesktop
Expand Down Expand Up @@ -82,7 +81,8 @@ public bool Run(bool forceImageUpdate = false, DisplayEvent overrideEvent = null
if (i < displayEvents.Count - 1)
{
string themeId = JsonConfig.settings.activeThemes[0];
if (themeId == null && JsonConfig.settings.activeThemes.Length > 1)
if (themeId == null && JsonConfig.settings.activeThemes.Length > 1 &&
i + 1 < JsonConfig.settings.activeThemes.Length)
{
themeId = JsonConfig.settings.activeThemes[i + 1];
}
Expand Down

0 comments on commit b1f0fc1

Please sign in to comment.