potential fix for an issue regarding undefined or null

This commit is contained in:
zefie
2024-05-17 14:18:20 -04:00
parent 8cf96ad5c2
commit 0a5a2eb964

View File

@@ -820,11 +820,13 @@ class WTVShared {
const passwordRegex = /(^pass$|passw(or)?d)/i; const passwordRegex = /(^pass$|passw(or)?d)/i;
let newobj = this.cloneObj(obj); // Clone the object once at the beginning let newobj = this.cloneObj(obj); // Clone the object once at the beginning
Object.keys(newobj.query).forEach((k) => { if (newobj.query) {
if (passwordRegex.test(k)) { Object.keys(newobj.query).forEach((k) => {
newobj.query[k] = '*'.repeat(newobj.query[k].length); if (passwordRegex.test(k)) {
} newobj.query[k] = '*'.repeat(newobj.query[k].length);
}); }
});
}
return newobj; return newobj;
} }