Last active
October 5, 2016 21:47
-
-
Save tjw/c79ffd3d920ffad2fcd4ca7d751a73cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let u = URL(fileURLWithPath: "/tmp/missing-path", isDirectory: true) | |
let d = FileManager.default.enumerator(at:u, includingPropertiesForKeys: nil, errorHandler: {_,_ in return false})! | |
print("d \(d)") // --> d <NSURLDirectoryEnumerator: 0x100a01940> | |
// Crashes, unless the error handler above is replaced with nil | |
for _ in d {} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment