Skip to content

Commit f533006

Browse files
committed
Fix crash in EventScheduler when number of monitors has increased
1 parent bf7a87f commit f533006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/EventScheduler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Collections.Generic;
88
using System.IO;
99
using System.Linq;
10-
using System.Threading.Tasks;
1110
using System.Windows.Forms;
1211

1312
namespace WinDynamicDesktop
@@ -82,7 +81,8 @@ public bool Run(bool forceImageUpdate = false, DisplayEvent overrideEvent = null
8281
if (i < displayEvents.Count - 1)
8382
{
8483
string themeId = JsonConfig.settings.activeThemes[0];
85-
if (themeId == null && JsonConfig.settings.activeThemes.Length > 1)
84+
if (themeId == null && JsonConfig.settings.activeThemes.Length > 1 &&
85+
i + 1 < JsonConfig.settings.activeThemes.Length)
8686
{
8787
themeId = JsonConfig.settings.activeThemes[i + 1];
8888
}

0 commit comments

Comments
 (0)