diff options
Diffstat (limited to 'src/musichub/main')
-rw-r--r-- | src/musichub/main/Main.java | 4 |
1 files changed, 3 insertions, 1 deletions
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(); |