Skip to content

Commit f2d54c7

Browse files
skelaamosavian
authored andcommitted
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
1 parent 0e9a82a commit f2d54c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/FileProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ extension FileProviderBasic {
219219
guard let path = path else { return nil }
220220
var p = path.hasPrefix("/") ? path : "/" + path
221221
if p.hasSuffix("/") {
222-
p.remove(at: p.endIndex)
222+
p.remove(at: p.index(before:p.endIndex))
223223
}
224224
return p
225225
}

0 commit comments

Comments
 (0)