Fixed crash within the command parser

This commit is contained in:
WolverinDEV 2020-02-02 18:54:14 +01:00
parent dd1fafeee9
commit fc934520a5

View File

@ -99,7 +99,7 @@ namespace ts {
while(++current_index > 0 || (current_index == 0 && !expect_type && (expect_type = true))) { while(++current_index > 0 || (current_index == 0 && !expect_type && (expect_type = true))) {
end_index = data.find_first_of(" |", current_index); end_index = data.find_first_of(" |", current_index);
if(end_index != current_index) { /* else we've found another space or a pipe */ if(end_index != current_index && current_index < data.length()) { /* else we've found another space or a pipe */
if(data[current_index] == '-') { if(data[current_index] == '-') {
string trigger(data.substr(current_index + 1, end_index - current_index - 1)); string trigger(data.substr(current_index + 1, end_index - current_index - 1));
result.paramethers.push_back(trigger); result.paramethers.push_back(trigger);