Ever since google forced the update "This project is running on our new Apps Script runtime powered by Chrome V8." I'm getting the following error and I don't understand why.
"Exception: Invalid argument: searchPattern at recreateReferral(recreateReferral:82:13)"
Here is the snippet of code: Line 82 starts with newBody.
for(i = 0; i <=16; i++) {
newBody.replaceText(fields[0][i], newData[0][i]);
}
I figured it out. It was the empty parts of the string as someone above suggested.
Thanks!
Possible cause(s):
Your original rhino script is buggy, because it doesn't check the type of the argument
fields[0][i]
andnewData[0][i]
.Empty string
""
andnull
also throw this error.Solution:
replaceText()
Snippet: