mirror of https://github.com/stella-emu/stella.git
Fix potential crash on empty string.
This commit is contained in:
parent
d428c6ac9a
commit
217f52822d
|
@ -367,7 +367,10 @@ bool FileListWidget::handleText(char text)
|
||||||
const bool firstShift = StellaModTest::isShift(_firstMod);
|
const bool firstShift = StellaModTest::isShift(_firstMod);
|
||||||
|
|
||||||
if(StellaModTest::isShift(_lastMod))
|
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)
|
if(_quickSelectTime < time)
|
||||||
_quickSelectStr = text;
|
_quickSelectStr = text;
|
||||||
|
|
Loading…
Reference in New Issue