Fix keyboard_input SEGFAULT

This commit is contained in:
Vasily
2019-05-25 18:49:42 +02:00
committed by username223
parent d6c7b52a47
commit e40058e58a
2 changed files with 26 additions and 1 deletions
+5 -1
View File
@@ -61,7 +61,7 @@ std::vector<Token> ParseKeyboardInputsToTokens( const std::string inputs )
{
std::vector<Token> tokens{};
for ( auto ch = inputs.begin(); ch != inputs.end(); ++ch )
for ( auto ch = inputs.begin(), end = inputs.end(); ch != end; ++ch )
{
if ( const auto c = getNumberOrLetter( *ch ); c.has_value() )
{
@@ -84,6 +84,10 @@ std::vector<Token> ParseKeyboardInputsToTokens( const std::string inputs )
if ( *ch == 'F' )
{
++ch;
if ( ch == end )
{
break;
}
const auto token = getFunctionNumber( *ch );
if ( token.has_value() )
{