Skip to content

Commit

Permalink
Fixed crash when adding a process event in an empty schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
StijnOostdam committed Aug 26, 2020
1 parent 22cf3fa commit 1be0f58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Winleafs.Wpf/Views/Scheduling/EventUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public bool ProcessEventTriggerAdded(string processName, string effectName, int
EffectName = effectName,
EventTriggerType = TriggerType.ProcessEvent,
ProcessName = processName,
Priority = EventTriggers.Max(eventTrigger => eventTrigger.Priority) + 1
Priority = EventTriggers.Count == 0 ? 1 : EventTriggers.Max(eventTrigger => eventTrigger.Priority) + 1
});

BuildTriggerList();
Expand Down

0 comments on commit 1be0f58

Please sign in to comment.