mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Throw an exception when creating a File object for a path that isn't a file
This exception is getting thrown inside of `Project.scan` when it incorrectly parses a path with newlines in it. But the exception gets swallowed by ChildProcess.exec. At least it prevents a file from being created that we don't end up unsubscribing from. But `Project.scan` needs to be improved.
This commit is contained in:
@@ -9,6 +9,7 @@ class File
|
||||
md5: null
|
||||
|
||||
constructor: (@path) ->
|
||||
throw "Creating file with path that is not a file: #{@path}" unless fs.isFile(@path)
|
||||
@updateMd5()
|
||||
|
||||
getPath: ->
|
||||
|
||||
Reference in New Issue
Block a user