From 368709ec0e01bdbbf63ae704608f6b1ffdada0e9 Mon Sep 17 00:00:00 2001 From: Alisa Mylnikova Date: Tue, 15 May 2018 15:47:45 +0700 Subject: [PATCH] Fix crash when dasharray pattern is set to "none" --- Source/svg/SVGParser.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/svg/SVGParser.swift b/Source/svg/SVGParser.swift index 2506c86e..7d8c8a4f 100644 --- a/Source/svg/SVGParser.swift +++ b/Source/svg/SVGParser.swift @@ -1215,6 +1215,9 @@ open class SVGParser { if let doubleValue = Double(string) { return doubleValue } + if string == "none" { + return 0 + } guard let matcher = SVGParserRegexHelper.getUnitsIdenitifierMatcher() else { return .none } let fullRange = NSRange(location: 0, length: string.count) if let match = matcher.firstMatch(in: string, options: .reportCompletion, range: fullRange) {