diff --git a/frontend/app/routing.js b/frontend/app/routing.js index 14de7f378b..dae35e32c6 100644 --- a/frontend/app/routing.js +++ b/frontend/app/routing.js @@ -37,7 +37,13 @@ angular.module('openproject') (function() { function valToString(val) { return val !== null ? val.toString() : val; } function valFromString(val) { return val !== null ? val.toString() : val; } - function regexpMatches(val) { /*jshint validthis:true */ return this.pattern.test(val); } + function regexpMatches(val) { + /*jshint validthis:true */ + // I'm not really sure why `val` can be undefined here, but undefined errors + // kept appearing after moving the routes around. + // This "fixes" it. Sorry. + return angular.isUndefined(val) ? false : this.pattern.test(val); + } $urlMatcherFactoryProvider.type('projectPathType', { encode: valToString, decode: valFromString,