diff --git a/AltStore/Operations/FetchTrustedSourcesOperation.swift b/AltStore/Operations/FetchTrustedSourcesOperation.swift index 8d57ec89..0cf51faa 100644 --- a/AltStore/Operations/FetchTrustedSourcesOperation.swift +++ b/AltStore/Operations/FetchTrustedSourcesOperation.swift @@ -41,6 +41,14 @@ class FetchTrustedSourcesOperation: ResultOperation<[FetchTrustedSourcesOperatio let dataTask = URLSession.shared.dataTask(with: .trustedSources) { (data, response, error) in do { + if let response = response as? HTTPURLResponse + { + guard response.statusCode != 404 else { + self.finish(.failure(URLError(.fileDoesNotExist, userInfo: [NSURLErrorKey: URL.trustedSources]))) + return + } + } + guard let data = data else { throw error! } let response = try Foundation.JSONDecoder().decode(Response.self, from: data) diff --git a/AltStore/Operations/UpdatePatronsOperation.swift b/AltStore/Operations/UpdatePatronsOperation.swift index 635504cb..c4d6301f 100644 --- a/AltStore/Operations/UpdatePatronsOperation.swift +++ b/AltStore/Operations/UpdatePatronsOperation.swift @@ -46,6 +46,14 @@ class UpdatePatronsOperation: ResultOperation let dataTask = URLSession.shared.dataTask(with: .patreonInfo) { (data, response, error) in do { + if let response = response as? HTTPURLResponse + { + guard response.statusCode != 404 else { + self.finish(.failure(URLError(.fileDoesNotExist, userInfo: [NSURLErrorKey: URL.patreonInfo]))) + return + } + } + guard let data = data else { throw error! } let response = try AltStoreCore.JSONDecoder().decode(Response.self, from: data)