From 280d2ebda38b9f92eccbe4028ed6a3c7e7ad2230 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 12 May 2022 23:21:17 +0200 Subject: [PATCH] fixed Error when IndexOutOfBoundsException in setDateofBirtch in Player.java --- .../main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java index 20c78d0..648776f 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java @@ -33,7 +33,7 @@ public class Player extends Person implements Participant{ String[] date = dateOfBirth.split("\\."); try{ 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(); throw new InvalidDateException("Date invalid"); }