FIXED: TypeError: Cannot read properties of undefined (reading 'replace')

This commit is contained in:
MernJs Community
2023-04-27 00:13:29 +05:30
parent dac93c590c
commit dc3714dec5

View File

@@ -13,8 +13,8 @@ function Query(queryObj) {
this.host = queryObj.host || "www.linkedin.com"; this.host = queryObj.host || "www.linkedin.com";
//api handles strings with spaces by replacing the values with %20 //api handles strings with spaces by replacing the values with %20
this.keyword = queryObj.keyword.replace(" ", "+") || ""; this.keyword = queryObj.keyword?.replace(" ", "+") || "";
this.location = queryObj.location.replace(" ", "+") || ""; this.location = queryObj.location?.replace(" ", "+") || "";
this.dateSincePosted = queryObj.dateSincePosted || ""; this.dateSincePosted = queryObj.dateSincePosted || "";
this.jobType = queryObj.jobType || ""; this.jobType = queryObj.jobType || "";
this.remoteFilter = queryObj.remoteFilter || ""; this.remoteFilter = queryObj.remoteFilter || "";