From 2a4fd98c988f6a6d384098944243b7b1f972c745 Mon Sep 17 00:00:00 2001 From: Bruno Muniz Azevedo Filho <bruno@elixxir.io> Date: Thu, 21 Jul 2022 15:49:23 -0300 Subject: [PATCH] Updating NDF is now infinitely recursive --- Sources/Integration/Implementations/Bindings.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Sources/Integration/Implementations/Bindings.swift b/Sources/Integration/Implementations/Bindings.swift index 7c6feb9f..a05387dd 100644 --- a/Sources/Integration/Implementations/Bindings.swift +++ b/Sources/Integration/Implementations/Bindings.swift @@ -154,17 +154,15 @@ extension BindingsClient: BindingsInterface { for env: NetworkEnvironment, _ completion: @escaping (Result<Data?, Error>) -> Void ) { - log(type: .crumbs) - var error: NSError? let ndf = BindingsDownloadAndVerifySignedNdfWithUrl(env.url, env.cert, &error) - if let error = error { - log(string: error.localizedDescription, type: .error) - completion(.failure(error)) - } else { - completion(.success(ndf)) + guard error == nil else { + Self.updateNDF(for: env, completion) + return } + + completion(.success(ndf)) } /// Fetches a JSON with up-to-date error descriptions -- GitLab