Fix undefined errors on show page.

pull/3563/head
Tim Habermaas 9 years ago committed by Stefan Botzenhart
parent 2ca60d7aab
commit 19155c8ed8
  1. 8
      frontend/app/routing.js

@ -37,7 +37,13 @@ angular.module('openproject')
(function() { (function() {
function valToString(val) { return val !== null ? val.toString() : val; } function valToString(val) { return val !== null ? val.toString() : val; }
function valFromString(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', { $urlMatcherFactoryProvider.type('projectPathType', {
encode: valToString, encode: valToString,
decode: valFromString, decode: valFromString,

Loading…
Cancel
Save