group and channel name can't be null

This commit is contained in:
2025-07-08 10:53:54 +03:30
parent f97a154869
commit b03569c1b7
4 changed files with 50 additions and 14 deletions
@@ -261,8 +261,16 @@ public class ActionHandler {
public void createGroup() {
System.out.print("Enter group ID: ");
String groupId = scanner.nextLine();
System.out.print("Enter group name: ");
String groupName = scanner.nextLine();
String groupName = null;
while (groupName == null) {
System.out.print("Enter group name: ");
String input = scanner.nextLine();
if (!input.trim().isEmpty()) {
groupName = input;
} else {
System.out.println("Group name can't be empty.");
}
}
System.out.print("Enter image URL (optional): ");
String imageUrl = scanner.nextLine();
@@ -281,8 +289,16 @@ public class ActionHandler {
public void createChannel() {
System.out.print("Enter channel ID: ");
String channelId = scanner.nextLine();
System.out.print("Enter channel name: ");
String channelName = scanner.nextLine();
String channelName = null;
while (channelName == null) {
System.out.print("Enter channel name: ");
String input = scanner.nextLine();
if (!input.trim().isEmpty()) {
channelName = input;
} else {
System.out.println("Channel name can't be empty.");
}
}
System.out.print("Enter image URL (optional): ");
String imageUrl = scanner.nextLine();