Run: Don't try to set a history selection if history is empty

This fixes an assertion on startup when there's no command history.
This commit is contained in:
Andreas Kling 2022-06-30 17:30:34 +02:00
parent c153d1779e
commit e98f8f20df

View file

@ -47,7 +47,8 @@ RunWindow::RunWindow()
m_path_combo_box = *main_widget.find_descendant_of_type_named<GUI::ComboBox>("path");
m_path_combo_box->set_model(m_path_history_model);
m_path_combo_box->set_selected_index(0);
if (!m_path_history.is_empty())
m_path_combo_box->set_selected_index(0);
m_ok_button = *main_widget.find_descendant_of_type_named<GUI::DialogButton>("ok_button");
m_ok_button->on_click = [this](auto) {