diff --git a/src/main/java/cactusServer/models/Accounts.java b/src/main/java/cactusServer/models/Accounts.java index 12b953d..ca25106 100644 --- a/src/main/java/cactusServer/models/Accounts.java +++ b/src/main/java/cactusServer/models/Accounts.java @@ -85,7 +85,7 @@ } public URIAddressedEntity loginAccount(String userID, String userPass) { - if (getAccountByID(userID).getPass().equals(userPass)) { + if (getAccountByID(userID) != null && getAccountByID(userID).getPass().equals(userPass)) { Accounts.getInstance().getAccountByID(userID).setLogin(true); Accounts.getInstance().getAccountByID(userID).formToken(); session = new URIAddressedEntity( @@ -104,7 +104,7 @@ public Account deleteAccount(String uniqueID) { Account edit = Accounts.getInstance().getAccountByuniqueID(uniqueID); - if(edit == null) { + if (edit == null) { return edit; } userIDSet.remove(edit.getId());