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

TypeError: Cannot read property 'trim' of undefined #143

Open
The-Compiler opened this issue Dec 19, 2020 · 0 comments
Open

TypeError: Cannot read property 'trim' of undefined #143

The-Compiler opened this issue Dec 19, 2020 · 0 comments

Comments

@The-Compiler
Copy link

When dockerfile_lint is passed a file with a line ending with a backslash, but no second line, such as this:

test \

it fails with:

TypeError: Cannot read property 'trim' of undefined
    at Object.parse (.../node_modules/dockerfile_lint/lib/parser.js:457:40)
    at Linter.validate (.../node_modules/dockerfile_lint/lib/linter.js:106:27)
    at lint (.../node_modules/dockerfile_lint/bin/dockerfile_lint:120:36)
    at .../node_modules/dockerfile_lint/bin/dockerfile_lint:129:13
    at new Promise (<anonymous>)
    at lintDockerFile (.../node_modules/dockerfile_lint/bin/dockerfile_lint:107:12)
    at .../node_modules/dockerfile_lint/bin/dockerfile_lint:86:16
    at Function.map (.../node_modules/lodash/dist/lodash.js:3509:27)
    at lintDockerFiles (.../node_modules/dockerfile_lint/bin/dockerfile_lint:82:26)
    at Object.<anonymous> (.../node_modules/dockerfile_lint/bin/dockerfile_lint:172:5)

The easiest way to reproduce is probably (with bash): dockerfile_lint -f <(echo 'test \\')

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

No branches or pull requests

1 participant