Skip to content

Commit

Permalink
IJMP-1409: add check if an empty command is entered
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzianis Lisiankou authored and Dzianis Lisiankou committed Mar 6, 2024
1 parent 981bb9e commit d071960
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class InputRecognizer(
*/
fun recognizeMessage(command: String) : Message<*> {
val upperCommand = command.toUpperCasePreservingASCIIRules().trim()
if (upperCommand.isEmpty()) {
previousCommand = upperCommand
return OrdinaryMessage(command, session)
}
val parseExecStm = upperCommand.substringBefore(" ")
if (parseExecStm == "EX" || parseExecStm == "EXEC" || previousCommand == "EX" || previousCommand == "EXEC") {
val parseAfterExec = upperCommand.substringAfter(" ").trim()
Expand Down

0 comments on commit d071960

Please sign in to comment.