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 can be thrown as "stdin" might be null or undefined here. #370

Closed
mgmacias95 opened this issue Apr 16, 2019 · 0 comments
Closed
Assignees
Labels

Comments

@mgmacias95
Copy link
Contributor

When a variable is assigned an undefined or null value, it has no properties. Trying to access properties of such a variable anyway results in a TypeError, causing abrupt termination of the script if the error is not caught in a catch block. But instead of catch-ing this condition, it is best to avoid it altogether.

if (stdin != null)
stdin['ossec_path'] = config.ossec_path;
// log
stdin['arguments']['wait_for_complete'] = disable_timeout;

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

2 participants