From 0aa1353ec9153891d989c76ba8fdfcbe83fb247c Mon Sep 17 00:00:00 2001
From: Bertrand Gauthier <bertrand.gauthier@unicaen.fr>
Date: Mon, 3 Feb 2020 09:34:52 +0100
Subject: [PATCH] Correction absence de test de diffusion null

---
 .../Application/src/Application/Controller/TheseController.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/module/Application/src/Application/Controller/TheseController.php b/module/Application/src/Application/Controller/TheseController.php
index d6b731e47..d4341f091 100755
--- a/module/Application/src/Application/Controller/TheseController.php
+++ b/module/Application/src/Application/Controller/TheseController.php
@@ -1169,11 +1169,12 @@ class TheseController extends AbstractController
     private function getAttestationTheseForm(VersionFichier $version)
     {
         $these = $this->requestedThese();
+        $diffusion = $these->getDiffusionForVersion($version);
 
         /** @var AttestationTheseForm $form */
         $form = $this->getServiceLocator()->get('formElementManager')->get('AttestationTheseForm');
 
-        if (! $these->getDiffusionForVersion($version)->isRemiseExemplairePapierRequise()) {
+        if ($diffusion && ! $diffusion->isRemiseExemplairePapierRequise()) {
             $form->disableExemplaireImprimeConformeAVersionDeposee();
         }
 
-- 
GitLab