Abort processing if there was no command

Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/1105/head
Jesse Vincent 3 years ago
parent 34e630438b
commit c9943057f4
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -45,6 +45,12 @@ EventHandlerResult FocusSerial::afterEachCycle() {
if (command_[i - 1] == SEPARATOR ) if (command_[i - 1] == SEPARATOR )
command_[i - 1] = '\0'; command_[i - 1] = '\0';
// If there was no command, there's nothing to do
if (command_[0] == '\0') {
return EventHandlerResult::OK;
}
Runtime.onFocusEvent(command_); Runtime.onFocusEvent(command_);
while (Runtime.serialPort().available()) { while (Runtime.serialPort().available()) {

Loading…
Cancel
Save