question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

execute.js not testing for undefined

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
theFrohcommented, Dec 12, 2017

Got bit by this, hell of a stacktrace to dig through if you accidentally pass undefined in! Definitely agree with throwing an early error.

0reactions
gazoakleycommented, Jan 31, 2018

There’s now a checked for undefined bind params:

https://github.com/sidorares/node-mysql2/pull/718

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found