Fixes #4938 make sure we deal with undefined parameters
Should make the JavascriptTests build green again