Browse Source

no resource abort 404

visuddhinanda 2 days ago
parent
commit
eb9170bc0e
1 changed files with 6 additions and 1 deletions
  1. 6 1
      api-v13/app/Http/Controllers/Library/WikiController.php

+ 6 - 1
api-v13/app/Http/Controllers/Library/WikiController.php

@@ -216,7 +216,12 @@ HTML,
             $term = $this->termService->communityWiki($word, $lang, 'html');
         }
 
-        $result = $this->searchService->get("term_{$term['guid']}");
+        try {
+            $result = $this->searchService->get("term_{$term['guid']}");
+        } catch (\Throwable $th) {
+            abort(404);
+        }
+
         if (isset($result['_source']['tags'])) {
             $quality = $this->getQuality($result['_source']['tags']);
         } else {