Przeglądaj źródła

Merge pull request #3565 from weseek/fix/5485-search-result-0-error

Fixed cannot destructure error
Yuki Takei 5 lat temu
rodzic
commit
f881f193c4
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      src/server/service/bolt.js

+ 3 - 2
src/server/service/bolt.js

@@ -189,7 +189,7 @@ class BoltService {
           this.generateMarkdownSectionBlock('`-tag:wiki` \n Exclude pages with wiki tag'),
           this.generateMarkdownSectionBlock('`-tag:wiki` \n Exclude pages with wiki tag'),
         ],
         ],
       });
       });
-      return;
+      return { resultPaths: [] };
     }
     }
 
 
     const resultPaths = results.data.map((data) => {
     const resultPaths = results.data.map((data) => {
@@ -208,9 +208,10 @@ class BoltService {
 
 
     const keywords = this.getKeywords(args);
     const keywords = this.getKeywords(args);
 
 
-    if (resultPaths == null) {
+    if (resultPaths.length === 0) {
       return;
       return;
     }
     }
+
     const base = this.crowi.appService.getSiteUrl();
     const base = this.crowi.appService.getSiteUrl();
 
 
     const urls = resultPaths.map((path) => {
     const urls = resultPaths.map((path) => {