Skip to content

Commit fe37807

Browse files
committed
Don’t crash if no VMs are running
1 parent 3360251 commit fe37807

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/hostmgr-helper/AppDelegate.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ extension AppDelegate: XPCServiceDelegate {
158158
func serviceShouldStopVM() async throws {
159159
#if arch(arm64)
160160
print("Delegate received `shouldStopVM`")
161-
try await self.stopVM()
161+
do {
162+
try await self.stopVM()
163+
} catch Errors.vmNotRunning {
164+
// This is fine – we don't need to do anything for this case
165+
}
162166
#endif
163167
}
164168
}

0 commit comments

Comments
 (0)