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

Empty fileCopyApprovedDirectories entry in YAML config file gives runtime error #152

Closed
mountaindude opened this issue Apr 12, 2021 · 1 comment
Labels
Milestone

Comments

@mountaindude
Copy link
Collaborator

Describe the bug
In the YAML config file, if fileCopyApprovedDirectoriesor fileMoveApprovedDirectories or fileDeleteApprovedDirectories is empty, a runtime error will happen:

D:\tools\butler-dev\globals.js:207
    config.get('Butler.fileCopyApprovedDirectories').forEach(element => {
                                                    ^

TypeError: Cannot read property 'forEach' of null
    at Object.<anonymous> (D:\tools\butler-dev\globals.js:207:53)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (D:\tools\butler-dev\butler.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)

Make Butler more tolerant to various config file settings.
Specifically, having just a header but no entries in a list should be ok.

For now the workaround is to remove those headings from the config file if they cause troubles.

@mountaindude mountaindude added this to the 5.3 milestone Apr 12, 2021
@mountaindude
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant