Skip to content

Commit

Permalink
Return false for isFile for empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Apr 3, 2019
1 parent 1d7b37b commit dd39c43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/SwiftLintFramework/Extensions/String+SwiftLint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ extension String {
}

internal var isFile: Bool {
if self.isEmpty {
return false
}
var isDirectoryObjC: ObjCBool = false
if FileManager.default.fileExists(atPath: self, isDirectory: &isDirectoryObjC) {
return !isDirectoryObjC.boolValue
Expand Down

0 comments on commit dd39c43

Please sign in to comment.