fix: app crashes when no windows are open

This commit is contained in:
Robinhuett authored and lwouis committed 2020-01-05 13:30:21 +09:00
1 parent 4317bedd9f
commit cecc53a0e0
1 file changed
+7 -5
+7 -5
View File
@@ -25,11 +25,13 @@ class TrackedWindows {
} }
private class func isSingleSpace() { private class func isSingleSpace() {
let firstSpaceIndex = list[0].spaceIndex if list.count > 0 {
for window in list { let firstSpaceIndex = list[0].spaceIndex
if window.spaceIndex != nil && window.spaceIndex != firstSpaceIndex { for window in list {
Spaces.singleSpace = false if window.spaceIndex != nil && window.spaceIndex != firstSpaceIndex {
return Spaces.singleSpace = false
return
}
} }
} }
Spaces.singleSpace = true Spaces.singleSpace = true