Skip to content
Snippets Groups Projects
Commit bd66ebd7 authored by michael.ramusi's avatar michael.ramusi
Browse files

fixed omission of get() call to optional

parent 023fb142
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ public class AccountDatabase {
}
public void creditAnAccount(int idAccount, double amount){
this.database.get(this.database.indexOf(getById(idAccount))).addAmount(amount);
this.database.get(this.database.indexOf(getById(idAccount).get())).addAmount(amount);
}
public boolean hasEnoughMoney(int idAccount, double price){
......@@ -37,6 +37,7 @@ public class AccountDatabase {
}
public void withdrawCreditAccount(int idAccount, double credit){
this.database.get(this.database.indexOf(getById(idAccount))).withdraw(credit);
System.out.println("ID:" + idAccount);
this.database.get(this.database.indexOf(getById(idAccount).get())).withdraw(credit);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment