Преглед на файлове

Merge pull request #180 from crowi/fix-error-on-search-page

Fix "can not read property" error on search page
Sotaro KARASAWA преди 9 години
родител
ревизия
b6b2cae2ee
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      resource/js/app.js

+ 4 - 1
resource/js/app.js

@@ -16,7 +16,10 @@ if (!window) {
 }
 
 const mainContent = document.querySelector('#content-main');
-const pageId = mainContent.attributes['data-page-id'].value || null;
+let pageId = null;
+if (mainContent !== null) {
+  pageId = mainContent.attributes['data-page-id'].value;
+}
 
 // FIXME
 const crowi = new Crowi({me: $('#content-main').data('current-username')}, window);