Pass empty list of `input_files' to FileBrowser on first run

- Default config has `input_files' set to None
- This was being passed to `FileBrowser' on Initialization
- But `FileBrowser' expects `content_files' of list type, not None
- This resulted in an unexpected NoneType failure
This commit is contained in:
Debanjum Singh Solanky 2022-09-09 07:18:05 +03:00
parent 3ddffdfba4
commit 588f598949

View file

@ -92,7 +92,7 @@ class MainWindow(QtWidgets.QMainWindow):
search_type_layout = QtWidgets.QVBoxLayout(search_type_settings) search_type_layout = QtWidgets.QVBoxLayout(search_type_settings)
enable_search_type = SearchCheckBox(f"Search {search_type.name}", search_type) enable_search_type = SearchCheckBox(f"Search {search_type.name}", search_type)
# Add file browser to set input files for given search type # Add file browser to set input files for given search type
input_files = FileBrowser(file_input_text, search_type, current_content_files) input_files = FileBrowser(file_input_text, search_type, current_content_files or [])
# Set enabled/disabled based on checkbox state # Set enabled/disabled based on checkbox state
enable_search_type.setChecked(current_content_files is not None and len(current_content_files) > 0) enable_search_type.setChecked(current_content_files is not None and len(current_content_files) > 0)