Bladeren bron

avoid exception if path is null

Angus McLeod 6 jaren geleden
bovenliggende
commit
3cdaa82ac5
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6

+ 1 - 1
assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6

@@ -25,7 +25,7 @@ export default {
 
     const existing = DiscourseURL.routeTo;
     DiscourseURL.routeTo = function(path, opts) {
-      if (path.indexOf('/w/') > -1) {
+      if (path && path.indexOf('/w/') > -1) {
         return window.location = path;
       }
       return existing.apply(this, [path, opts]);