From c61ce2e94a1be121414670f93987abdd29d389c6 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Fri, 25 Jun 2021 18:27:54 +0200 Subject: Fixing STZ-0004 issue. --- src/musichub/main/Main.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/musichub') diff --git a/src/musichub/main/Main.java b/src/musichub/main/Main.java index f917b01..b72a95b 100644 --- a/src/musichub/main/Main.java +++ b/src/musichub/main/Main.java @@ -20,8 +20,10 @@ public class Main { if (choice.length() == 0) System.exit(0); - while (choice.charAt(0) != 'q') { + while (!choice.equals("")) { //if the user puts nothing, quit the loop/system switch (choice.charAt(0)) { + case 'q': //added the option directly in the switch instead of the loop + System.exit(0); case 'h': printAvailableCommands(); choice = scan.nextLine(); -- cgit v1.2.3