Skip to content

Commit b2da490

Browse files
fix: don't create http client if signed out (#166)
If the session item in the keychain is missing but `hasSession` is true, the app will force unwrap the session token optional and crash on launch. Encountered this today.
1 parent 29c4f41 commit b2da490

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Coder-Desktop/Coder-Desktop/State.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class AppState: ObservableObject {
120120
_sessionToken = Published(initialValue: keychainGet(for: Keys.sessionToken))
121121
if sessionToken == nil || sessionToken!.isEmpty == true {
122122
clearSession()
123+
return
123124
}
124125
client = Client(
125126
url: baseAccessURL!,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy