mirror of https://github.com/stella-emu/stella.git
Fix potential crash on empty string.
This commit is contained in:
parent
1657538b87
commit
da0b491429
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue