fixed Error when IndexOutOfBoundsException in setDateofBirtch in Player.java
This commit is contained in:
@@ -33,7 +33,7 @@ public class Player extends Person implements Participant{
|
|||||||
String[] date = dateOfBirth.split("\\.");
|
String[] date = dateOfBirth.split("\\.");
|
||||||
try{
|
try{
|
||||||
this.dateOfBirth = LocalDate.of(Integer.valueOf(date[2]), Integer.valueOf(date[1]), Integer.valueOf(date[0]));
|
this.dateOfBirth = LocalDate.of(Integer.valueOf(date[2]), Integer.valueOf(date[1]), Integer.valueOf(date[0]));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException | IndexOutOfBoundsException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new InvalidDateException("Date invalid");
|
throw new InvalidDateException("Date invalid");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user