Skip to content

Commit

Permalink
Merge pull request #17 from Trendyol/fix/AddMoreCheckForCollectionAcc…
Browse files Browse the repository at this point in the history
…essing

fix/AddMoreCheckForCollectionAccessing
  • Loading branch information
yusufozgul authored Mar 28, 2024
2 parents 0aca96e + 554da9b commit 1a097ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Core/CommonKit/Sources/CommonKit/Utils/FileUrlBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public final class FileUrlBuilder: FileUrlBuilderInterface {


for (index, configPathComponent) in configPathComponents.enumerated() {
guard configPathComponent != requestPathComponents[index] else { continue }
guard configPathComponent != requestPathComponents[safe: index] else { continue }

if configPathComponent == "*" {
requestPathComponents[index] = "*"
Expand Down Expand Up @@ -177,7 +177,9 @@ public final class FileUrlBuilder: FileUrlBuilderInterface {

for (index, configPathComponent) in configPathComponents.enumerated() {
guard configPathComponent != requestPathComponents[safe: index] && configPathComponent != "*" else {
controlPathComponents.append(requestPathComponents[index])
if let component = requestPathComponents[safe: index] {
controlPathComponents.append(component)
}
continue
}
return false
Expand Down

0 comments on commit 1a097ed

Please sign in to comment.