Fix potential crash on empty string.

This commit is contained in:
Stephen Anthony 2022-12-24 13:21:13 -03:30
parent 1657538b87
commit da0b491429
1 changed files with 4 additions and 1 deletions

View File

@ -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;