diff --git a/.werks/17462 b/.werks/17462 new file mode 100644 index 00000000000..983507b9ceb --- /dev/null +++ b/.werks/17462 @@ -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. diff --git a/cmk/gui/plugins/sidebar/search.py b/cmk/gui/plugins/sidebar/search.py index 0fd372c9ddd..a39183daefb 100644 --- a/cmk/gui/plugins/sidebar/search.py +++ b/cmk/gui/plugins/sidebar/search.py @@ -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) @@ -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 )