mirror of
https://codeberg.org/secana/Forji.git
synced 2026-06-16 05:13:55 -07:00
fix: don't crash background notification poll on an invalid instance URL
buildRequest force-unwrapped URLComponents(string:) built from the user-entered server URL, so a value that doesn't parse as a URL crashed the background refresh task. Guard it and return nil, matching the keychain failure path already in this method. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b0f50eca38
commit
af5d50ffd3
1 changed files with 3 additions and 1 deletions
|
|
@ -87,7 +87,9 @@ final class BackgroundDownloadManager: NSObject, Sendable {
|
|||
for: instance.serverURL, username: instance.username,
|
||||
) else { return nil }
|
||||
|
||||
var components = URLComponents(string: "\(instance.serverURL)/api/v1/notifications")!
|
||||
guard var components = URLComponents(string: "\(instance.serverURL)/api/v1/notifications") else {
|
||||
return nil
|
||||
}
|
||||
components.queryItems = [
|
||||
URLQueryItem(name: "status-types", value: "unread"),
|
||||
URLQueryItem(name: "page", value: "1"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue