Skip to content

Commit 3ace9a0

Browse files
committed
Fixed reference to userdatabase based on new constructor
1 parent 3b0f17f commit 3ace9a0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/main/java/UserReader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
public class UserReader {
44
public String[] UserReader(User user) {
55
String email = user.getEmail();
6+
String username = user.getUsername();
67
String[] out = new String[] {username, email};
78
return out;
89
}

src/main/java/UserSearchUI.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void actionPerformed(ActionEvent e) {
3636
@Override
3737
public String showProfile(String username) {
3838
// setting up access to the database of users:
39-
UserDatabase db = UserDatabase(accounts);
39+
UserDatabase db = new UserDatabase();
4040
if (db.UserExists(username)){
4141
User user = db.getUser(username);
4242
UserReader reader = new UserReader();
@@ -50,10 +50,10 @@ public String showProfile(String username) {
5050
}
5151

5252
// for trying out the code:
53-
public static void main(String[] args) {
54-
new UserSearchUI();
55-
56-
}
53+
// public static void main(String[] args) {
54+
// new UserSearchUI();
55+
//
56+
// }
5757

5858
}
5959

0 commit comments

Comments
 (0)