Skip to content

Commit

Permalink
17462 FIX Don't create crash report on invalid regex in quicksearch
Browse files Browse the repository at this point in the history
SUP-21223

Change-Id: I9a728af925b434460d4ce923cdd84851e3e2d527
  • Loading branch information
makanakoeln committed Dec 17, 2024
1 parent e647056 commit 19f04a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .werks/17462
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Title: Don't create crash report on invalid regex in quicksearch
Class: fix
Compatible: compat
Component: multisite
Date: 1734348625
Edition: cre
Level: 1
Version: 2.2.0p38

If an invalid regex was used in the quicksearch, a user error message was
shown and in the background a crash report was created.

Now only the user error message will be shown.
4 changes: 4 additions & 0 deletions cmk/gui/plugins/sidebar/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ def _ajax_search(self) -> None:
if not query:
return

search_objects: list[ABCQuicksearchConductor] = []
try:
search_objects = self._quicksearch_manager._determine_search_objects(
livestatus.lqencode(query)
Expand All @@ -764,6 +765,9 @@ def _ajax_search(self) -> None:
raise
html.show_error(traceback.format_exc())

if not search_objects:
return

QuicksearchResultRenderer().show(
self._quicksearch_manager._evaluate_results(search_objects), query
)
Expand Down

0 comments on commit 19f04a8

Please sign in to comment.