From f2d54c7f923627448dbf0983a40da19fb11f79aa Mon Sep 17 00:00:00 2001 From: Alek Slater Date: Mon, 19 Dec 2016 22:40:14 +0800 Subject: [PATCH] incorrect usage of string.remove in correctPath method - string remove needs to be given the index before the endIndex or it will crash (#22) needs to be given the index before the endIndex or it will crash --- Sources/FileProvider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FileProvider.swift b/Sources/FileProvider.swift index efa2b4a..a1faa60 100644 --- a/Sources/FileProvider.swift +++ b/Sources/FileProvider.swift @@ -219,7 +219,7 @@ extension FileProviderBasic { guard let path = path else { return nil } var p = path.hasPrefix("/") ? path : "/" + path if p.hasSuffix("/") { - p.remove(at: p.endIndex) + p.remove(at: p.index(before:p.endIndex)) } return p }