diff --git a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java index a408db7..64bd8e3 100644 --- a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java +++ b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java @@ -144,9 +144,12 @@ public class PartieKahootController { partieKahoot = this.partieKahootService.maintenirAJourQuestionActuel(partieKahoot); Joueur joueur = this.joueurService.findById(request.getIdJoueur()); - if(partieKahoot.getStatus() != Status.Started){ + if(partieKahoot.getStatus() == Status.Pending){ throw new PartyNotStartedException(); } + if(partieKahoot.getStatus() == Status.Ended){ + throw new PartyIsEndedException(); + } if(partieKahoot.getJoueurs().stream().noneMatch(joueur1 -> Objects.equals(joueur1.getId(), joueur.getId()))){ throw new JoueurPasDansPartieException();