execute.js not testing for undefined
See original GitHub issueI ran into a problem passing an undefined value to a query which caused the node server to crash. The problem was found in execute.js for all 3 occurrences of
this.parameters[i] !== null
Changing these 3 occurrences to
this.parameters[i] !== undefined
eliminated the problem. Checking for null and undefined would probably be ideal.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
How can I check for "undefined" in JavaScript? - Stack Overflow
To catch whether or not that variable is declared or not, you may need to resort to the in operator. (In many cases,...
Read more >JavaScript Check if Undefined – How to Test for Undefined in JS
An undefined variable or anything without a value will always return "undefined" in JavaScript. This is not the same as null, ...
Read more >undefined - JavaScript - MDN Web Docs - Mozilla
A variable that has not been assigned a value is of type undefined . A method or statement also returns undefined if the...
Read more >How to check for undefined in JavaScript
You can use the void operator to obtain the value of undefined . This will work even if the global window.undefined value has...
Read more >How to check for undefined in JavaScript - ui.dev
The way I recommend to check for undefined in JavaScript is using the strict equality operator, === , and comparing it to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Got bit by this, hell of a stacktrace to dig through if you accidentally pass undefined in! Definitely agree with throwing an early error.
There’s now a checked for undefined bind params:
https://github.com/sidorares/node-mysql2/pull/718