Do not try retrieve an unconfigured core content type in Config GUI

Previous behavior was resulting in a null reference error. As key for
the core content/search type was not present in current config

Fallback to using default config for unconfigured core content type
instead

See #165 for details
This commit is contained in:
Debanjum Singh Solanky
2023-03-02 11:09:31 -06:00
parent 1ae40163a9
commit b6dbe4dd1d

View File

@@ -58,9 +58,9 @@ class MainWindow(QtWidgets.QMainWindow):
# Add Settings Panels for each Search Type to Configure Window Layout
self.search_settings_panels = []
for search_type in SearchType:
current_content_config = self.current_config["content-type"][search_type] or self.get_default_config(
search_type=search_type
)
current_content_config = self.current_config["content-type"].get(
search_type, None
) or self.get_default_config(search_type=search_type)
self.search_settings_panels += [self.add_settings_panel(current_content_config, search_type)]
# Add Conversation Processor Panel to Configure Screen