File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
src/main/java/com/connect Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ public RoomDTO(Room room) {
2020 this .roomId = room .getRoomId ().toString ();
2121 this .roomName = room .getRoomName ();
2222 this .roomDescription = room .getRoomDescription ();
23- this .admin = room .getAdmin ().getUsername ();
23+ if (room .getAdmin () != null ) {
24+ this .admin = room .getAdmin ().getUsername ();
25+ }
2426 }
2527}
Original file line number Diff line number Diff line change @@ -34,9 +34,6 @@ public void init() {
3434 Optional <Room > room = roomRepository .findRoomByName (ROOM_NAME );
3535 if (room .isEmpty ()) {
3636 // Have to create the first room.
37- User admin = new User ();
38- admin .setUsername ("ADITYA" );
39- admin .setUserRole (List .of (UserRole .ADMIN ));
4037 Room generalRoom = new Room (
4138 ROOM_NAME ,
4239 "A public space for all users to chat, ask questions, and share updates."
You can’t perform that action at this time.
0 commit comments