Skip to content

Commit 24253ca

Browse files
authored
Merge pull request #22 from optimizely/anwar/EHS-50
[EHS-50] Add null/undefined checking in canonicalPath in extractPath method
2 parents a7da319 + dd7852e commit 24253ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/fns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function extractQueryParams(path) {
3636
* @return {String}
3737
*/
3838
function extractPath(base, canonicalPath) {
39-
let path = canonicalPath.replace(base, '') || '/'
39+
let path = canonicalPath?.replace(base, '') || '/'
4040
let qsIndex = path.indexOf('?')
4141
return (qsIndex > -1) ? path.slice(0, qsIndex) : path
4242
}

0 commit comments

Comments
 (0)