소스 검색

avoid exception if path is null

Angus McLeod 6 년 전
부모
커밋
3cdaa82ac5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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]);