From 3cb5c8395fed189fcb6bb31dc87d7f81d1782a47 Mon Sep 17 00:00:00 2001 From: Steve Broshar Date: Tue, 17 Jan 2023 15:58:47 -0600 Subject: [PATCH] Fix compiler error by adding 'try!' Fix compiler error by adding 'try!' --- MetaWear/DFU/FirmwareBuild.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MetaWear/DFU/FirmwareBuild.swift b/MetaWear/DFU/FirmwareBuild.swift index 8d937319..83b6ad5d 100644 --- a/MetaWear/DFU/FirmwareBuild.swift +++ b/MetaWear/DFU/FirmwareBuild.swift @@ -86,9 +86,9 @@ public struct FirmwareBuild { return task.continueOnSuccessWithTask { fileUrl in var selectedFirmware: DFUFirmware? if fileUrl.pathExtension.caseInsensitiveCompare("zip") == .orderedSame { - selectedFirmware = DFUFirmware(urlToZipFile: fileUrl) + selectedFirmware = try! DFUFirmware(urlToZipFile: fileUrl) } else { - selectedFirmware = DFUFirmware(urlToBinOrHexFile: fileUrl, urlToDatFile: nil, type: .application) + selectedFirmware = try! DFUFirmware(urlToBinOrHexFile: fileUrl, urlToDatFile: nil, type: .application) } guard let firmware = selectedFirmware else { return Task(error: MetaWearError.operationFailed(message: "invalid dfu file chosen '\(fileUrl.lastPathComponent)'"))