Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
trim input
Browse files Browse the repository at this point in the history
  • Loading branch information
Laifsyn committed Jun 24, 2024
1 parent 088f5a2 commit 612c074
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,16 @@ public void send_command(CMD cmd) {
switch (cmd) {
case Buscar(String codigo) -> {
Cliente cliente = null;
for (Cliente cliente_n : clientes) {
if (cliente_n.codigo().equals(codigo)) {
if (!last_buscar_result) {
last_buscar_result = true;
System.out.println("Cliente existe: `" + cliente_n.codigo() + "`");
if (!codigo.trim().isEmpty()) {
for (Cliente cliente_n : clientes) {
if (cliente_n.codigo().equals(codigo)) {
if (!last_buscar_result) {
last_buscar_result = true;
System.out.println("Cliente existe: `" + cliente_n.codigo() + "`");
}
cliente = cliente_n;
break;
}
cliente = cliente_n;
break;
}
}
if (cliente == null) {
Expand Down

0 comments on commit 612c074

Please sign in to comment.