diff --git a/src/ncurses.cc b/src/ncurses.cc index 3280329a..a248405b 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -334,7 +334,7 @@ void NCursesUI::menu_show(const memoryview& choices, CharCount longest = 0; for (auto& choice : choices) { - m_choices.push_back(choice.substr(0_char, std::min((int)maxsize.column-1, 200))); + m_choices.push_back(choice.empty() ? " " : choice.substr(0_char, std::min((int)maxsize.column-1, 200))); m_items.emplace_back(new_item(m_choices.back().c_str(), "")); longest = std::max(longest, m_choices.back().char_length()); }