소스 검색

Merge pull request #3115 from weseek/fix/4302-4524-fix-error-without-page

Fix/4302 4524 fix error without page
Yuki Takei 5 년 전
부모
커밋
8b3eb442c1
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/client/js/legacy/crowi.js

+ 6 - 0
src/client/js/legacy/crowi.js

@@ -157,6 +157,12 @@ Crowi.highlightSelectedSection = function(hash) {
 window.addEventListener('load', (e) => {
   const { appContainer } = window;
   const pageContainer = appContainer.getContainer('PageContainer');
+
+  // Do nothing if the page does not exist
+  // ex.) admin page,login page
+  if (pageContainer == null) {
+    return null;
+  }
   const { isAbleToOpenPageEditor } = pageContainer;
 
   // hash on page