Fix "Cannot read property 'split' of undefined"

Fix "Cannot read property 'split' of undefined" when using php-cs-fixer.
This bug has also been mentioned here: https://github.com/Glavin001/atom-beautify/issues/2044
This commit is contained in:
Enea Dolcini 2019-07-29 15:09:46 +02:00 committed by GitHub
parent 41d5051b39
commit b9e30d8100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ module.exports = class PHPCSFixer extends Beautifier
options.cs_fixer_config_file = if context? and context.filePath? then @findFile(path.dirname(context.filePath), configFiles)
# Try again to find a config file in the project root
if not options.cs_fixer_config_file
if not options.cs_fixer_config_file and atom.project.getPaths()[0]
options.cs_fixer_config_file = @findFile(atom.project.getPaths()[0], configFiles)
phpCsFixerOptions = [