Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When you alt-tab without any active app application crash #95

Closed
Xicy opened this issue Dec 28, 2019 · 1 comment
Closed

When you alt-tab without any active app application crash #95

Xicy opened this issue Dec 28, 2019 · 1 comment

Comments

@Xicy
Copy link

Xicy commented Dec 28, 2019

When list count equals 0 and step 0, try to modulo to 0 and return undefined and crash, you can use list.count == 0 ? 0 : like that function for prevent crashing

 static func moveFocusedWindowIndex(_ step: Int) -> Int {
        return list.count == 0 ? 0 : (focusedWindowIndex + step < 0 ? list.count - 1 : (focusedWindowIndex + step) % list.count)
    }
@lwouis
Copy link
Owner

lwouis commented Dec 30, 2019

Thank you very much for sharing this issue! I made a fix and merged it to release a new version today! It should fix that issue :)

lwouis pushed a commit that referenced this issue Dec 30, 2019
## [2.0.1](v2.0.0...v2.0.1) (2019-12-30)

### Bug Fixes

* app crashes when invoked when there is 0 window (closes [#95](#95)) ([921590a](921590a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants