Cannot read properties of null (reading 'replace')

Pavan Santhosh1
Tera Contributor

When Iam running ATF, it is getting failed and stating like 'Cannot read properties of null (reading 'replace').

 

Can anyone help me about how to fix this type of issue to proceed further.

Please find the screenshot below.

2 REPLIES 2

RaghavSh
Kilo Patron

There is some string function being done on non-string or empty value.

add .toString() to the string which is being replaced.


Raghav
MVP 2023

jaheerhattiwale
Mega Sage
Mega Sage

@Pavan Santhosh1 There is some code where .replace is used but the string is undefined. So check where .replace is used and fix the issue with undefined.

 

Ex:

var a = undefned;

a.replace('s','');

 

In above example a is undefined and hence replace cannot be used on it.

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023