Browse Source

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

Fix/4302 4524 fix error without page
Yuki Takei 5 năm trước cách đây
mục cha
commit
8b3eb442c1
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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