1. Olemis Lang
  2. bloodhound-tlp

Commits

mat...@13f79535-47bb-0310-9956-ffa450edef68  committed 7bc9ac3

fix for bhsearch crashing sporadically

  • Participants
  • Parent commits 7ed8e08
  • Branches bep_0003_multiproduct

Comments (0)

Files changed (1)

File bloodhound_search/bhsearch/web_ui.py

View file
  • Ignore whitespace
         return handler
 
     def post_process_request(self, req, template, data, content_type):
-        if self.redirect_enabled:
-            data['search_handler'] = req.href.bhsearch()
-        elif req.path_info.startswith(SEARCH_URL):
-            data['search_handler'] = req.href.search()
-        elif self.default_search or req.path_info.startswith(BHSEARCH_URL):
-            data['search_handler'] = req.href.bhsearch()
-        else:
-            data['search_handler'] = req.href.search()
+        if data is not None:
+            if self.redirect_enabled:
+                data['search_handler'] = req.href.bhsearch()
+            elif req.path_info.startswith(SEARCH_URL):
+                data['search_handler'] = req.href.search()
+            elif self.default_search or req.path_info.startswith(BHSEARCH_URL):
+                data['search_handler'] = req.href.bhsearch()
+            else:
+                data['search_handler'] = req.href.search()
         return template, data, content_type