From cf0504437b214d9035e969cb9bf4e7ba02f5f540 Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Thu, 13 Aug 2020 23:23:24 +0900 Subject: [PATCH] fix: rare crash when the os was not providing the current space id --- src/logic/Spaces.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logic/Spaces.swift b/src/logic/Spaces.swift index 0dcb3c34..e64fbf6d 100644 --- a/src/logic/Spaces.swift +++ b/src/logic/Spaces.swift @@ -35,7 +35,7 @@ class Spaces { refreshCurrentSpaceId() currentSpaceIndex = idsAndIndexes.first { (spaceId: CGSSpaceID, _) -> Bool in spaceId == currentSpaceId - }!.1 + }?.1 ?? SpaceIndex(1) debugPrint("Current space", currentSpaceId) }