ajaxCall() does'nt check parameters
Posted: 13 November 2020, 23:33
I can observe the following in the DevTools when calling ajaxCall() in one of the handled states in onEnteringState() of my ziga.js file :
This leads to the definition of ajaxCall() :
I tumbled upon this when missing a second parameter to ajaxCall(),
It looks here that arguments[1] is never checked and ajaxCall() would probably benefit from checking the arguments array. In this case, arguments[1] was undefined. Number of parameters in ajaxCalls would benefit being checked.
Zig
Code: Select all
ly_studio.js:formatted:26994 Uncaught TypeError: Cannot set property 'table' of undefined
at Object.ajaxcall (ly_studio.js:formatted:26994)
at HTMLInputElement.<anonymous> (ziga.js?1605306221109:99)Code: Select all
ajaxcall: function() {
var url = arguments[0];
if (g_archive_mode) {
[...]
} else {
if (url.charAt(0) == "/") {
var _d6e = "/" + this.game_name + "/" + this.game_name;
if (url.substr(0, _d6e.length) == _d6e) {
arguments[0] = url.substr(1);
} else {}
}
}
arguments[1].table = this.table_id;
if (this.forceTestUser !== null) {
arguments[1].testuser = this.forceTestUser;
}
return this.inherited(arguments);
},It looks here that arguments[1] is never checked and ajaxCall() would probably benefit from checking the arguments array. In this case, arguments[1] was undefined. Number of parameters in ajaxCalls would benefit being checked.
Zig