From 4fa5cb30ead858adfbd5e24e99fab6c1266680f4 Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 6 Dec 2019 11:00:10 +0100 Subject: [PATCH] correction --- .../src/Cadoles/CoreBundle/Controller/GroupController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php index 248eeddf..a1975ee4 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -599,9 +599,11 @@ class GroupController extends Controller // Notification message $usergroup = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$this->getUser(),"group"=>$id)); - $user=$em->getRepository("CadolesCoreBundle:User")->find($this->getUser()); - $message="Désinscription de l'utilisateur
".$user->getLastname()." ".$user->getFirstname()."
Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();; - $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($usergroup->getKeyvalue(),$this->getUser()->getId(),$id,$message); + if($usergroup) { + $user=$em->getRepository("CadolesCoreBundle:User")->find($this->getUser()); + $message="Désinscription de l'utilisateur
".$user->getLastname()." ".$user->getFirstname()."
Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();; + $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($usergroup->getKeyvalue(),$this->getUser()->getId(),$id,$message); + } // Desinscription $em->remove($usergroup);