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() {
let firstSpaceIndex = list[0].spaceIndex
for window in list {
if window.spaceIndex != nil && window.spaceIndex != firstSpaceIndex {
Spaces.singleSpace = false
return
if list.count > 0 {
let firstSpaceIndex = list[0].spaceIndex
for window in list {
if window.spaceIndex != nil && window.spaceIndex != firstSpaceIndex {
Spaces.singleSpace = false
return
}
}
}
Spaces.singleSpace = true