From 0fe9235198cb469563d4b8379575ea3e557a57f2 Mon Sep 17 00:00:00 2001 From: Arthur Semenyutin Date: Mon, 25 Nov 2019 17:14:24 +1100 Subject: [PATCH] #640 Remove force unwrap in `SVGParser.doubleFromString` method --- Source/svg/SVGParser.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/svg/SVGParser.swift b/Source/svg/SVGParser.swift index 69a405f3..6db95235 100644 --- a/Source/svg/SVGParser.swift +++ b/Source/svg/SVGParser.swift @@ -1675,7 +1675,7 @@ open class SVGParser { let unitString = (string as NSString).substring(with: match.range(at: 1)) let numberString = String(string.dropLast(unitString.count)) - let value = Double(numberString)! + let value = Double(numberString) ?? 0 switch unitString { case "px" : return value