Skip to content

Commit

Permalink
Fix for WebCacheManager crash (#2042)
Browse files Browse the repository at this point in the history
  • Loading branch information
amddg44 authored Sep 26, 2023
1 parent decefae commit dc15e7a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Core/WebCacheManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ public class WebCacheManager {
.appendingPathComponent("WebKit/\(bundleID)/WebsiteData/ResourceLoadStatistics/observations.db")
]

return databaseURLs.lazy.compactMap({ try? DatabasePool(path: $0.absoluteString) }).first
guard let validURL = databaseURLs.first(where: { FileManager.default.fileExists(atPath: $0.path) }),
let pool = try? DatabasePool(path: validURL.absoluteString) else {
return nil
}

return pool
}


Expand Down

0 comments on commit dc15e7a

Please sign in to comment.