diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index 9af9c22d7..b0ed277fe 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -367,7 +367,10 @@ bool FileListWidget::handleText(char text) const bool firstShift = StellaModTest::isShift(_firstMod); if(StellaModTest::isShift(_lastMod)) - text = StellaKeyName::forKey(_lastKey)[0]; + { + const string_view key = StellaKeyName::forKey(_lastKey); + text = !key.empty() ? key.front() : '\0'; + } if(_quickSelectTime < time) _quickSelectStr = text;