Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Loop/Core/LoopManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ extension LoopManager {
}

private func getNextCycleAction(_ action: WindowAction) async -> WindowAction {
guard let currentCycle = action.cycle else {
// An empty cycle has no actions to advance to; bail out instead of indexing
// into it — the `currentCycle[0]` accesses below would trap on an empty array
// (EXC_BREAKPOINT crash when a cycle action is configured with no sub-actions).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit too verbose. It’s definitely a bug, but I think it’s already fairly clear what !currentCycle.isEmpty is trying to fix here.

guard let currentCycle = action.cycle, !currentCycle.isEmpty else {
return action
}

Expand Down