diff options
author | Andreas Kling <kling@serenityos.org> | 2022-06-30 17:30:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-06-30 17:31:07 +0200 |
commit | e98f8f20df86ce0e0a48ec10d9406ec73ab83330 (patch) | |
tree | d24e7d1c803dcd03231b8a531cb7463d48eb0ef7 /Userland/Applications | |
parent | c153d1779eee424fcb47645ea16e93d4eaad8d83 (diff) | |
download | serenity-e98f8f20df86ce0e0a48ec10d9406ec73ab83330.zip |
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.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/Run/RunWindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Applications/Run/RunWindow.cpp b/Userland/Applications/Run/RunWindow.cpp index de18e987ce..3c551b0f2f 100644 --- a/Userland/Applications/Run/RunWindow.cpp +++ b/Userland/Applications/Run/RunWindow.cpp @@ -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) { |