Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/Foundation/FileManager+Win32.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ extension FileManager {
override func nextObject() -> Any? {
func firstValidItem() -> URL? {
while let url = _stack.popLast() {
if !FileManager.default.fileExists(atPath: url.path) {
guard let handler = _errorHandler else { return nil }
if !handler(url, _NSErrorWithWindowsError(GetLastError(), reading: true, paths: [url.path])) {
guard FileManager.default.fileExists(atPath: url.path) else {
if let handler = _errorHandler, !handler(url, _NSErrorWithWindowsError(GetLastError(), reading: true, paths: [url.path])) {
return nil
}
continue
}
_lastReturned = url
return _lastReturned
Expand Down