Skip to content

Commit 1ff4434

Browse files
committed
Put pathOverwriter in try...catch and fallback to old path
1 parent a7c37b0 commit 1ff4434

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/default.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,17 @@
680680
try {
681681
path = overwrite || decodeURIComponentFunc(loc.pathname);
682682
} catch (e) {
683-
// Do nothing
683+
warn(error);
684684
}
685685

686686
/** if pathoverwriter **/
687687
var pathOverwriterFunction = window[pathOverwriter];
688688
if (isFunction(pathOverwriterFunction)) {
689-
path = pathOverwriterFunction.call(window, path);
689+
try {
690+
path = pathOverwriterFunction.call(window, { path: path }) || path;
691+
} catch (error) {
692+
warnInFunction("path", error);
693+
}
690694
}
691695
/** endif **/
692696

0 commit comments

Comments
 (0)