Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-10277] FileManager.fileExists crashes for empty paths #3496

Closed
keith opened this issue Apr 3, 2019 · 1 comment
Closed

[SR-10277] FileManager.fileExists crashes for empty paths #3496

keith opened this issue Apr 3, 2019 · 1 comment
Assignees

Comments

@keith
Copy link
Contributor

keith commented Apr 3, 2019

Previous ID SR-10277
Radar None
Original Reporter @keith
Type Bug
Status Resolved
Resolution Done
Environment

Ubuntu 16.04 Swift 5.0

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @spevans
Priority Medium

md5: 30af0148822e99bff813a62dde927d35

Issue Description:

Using Swift 5 on Linux, this code crashes:

import Foundation

print(FileManager.default.fileExists(atPath: ""))

I believe because it hits this precondition

precondition(path != "", "Empty path argument")

This doesn't crash on macOS with the same API.

@spevans
Copy link
Collaborator

spevans commented Apr 22, 2019

#2066

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants