Commit 9148653e742993cda05f5a1ad588f7f453a32bb9
1 parent
5701b3da
Exists in
master
and in
1 other branch
removendo NotFoundException desnecessário
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
src/Cacic/CommonBundle/Controller/ComputadorController.php
@@ -175,6 +175,7 @@ class ComputadorController extends Controller | @@ -175,6 +175,7 @@ class ComputadorController extends Controller | ||
175 | public function updateAction( Request $request, $idComputador) | 175 | public function updateAction( Request $request, $idComputador) |
176 | { | 176 | { |
177 | $computador = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Computador' )->find( $idComputador ); | 177 | $computador = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Computador' )->find( $idComputador ); |
178 | + | ||
178 | if ( !$computador ) | 179 | if ( !$computador ) |
179 | throw $this->createNotFoundException( 'Computador não encontrado' ); | 180 | throw $this->createNotFoundException( 'Computador não encontrado' ); |
180 | else | 181 | else |
@@ -183,8 +184,6 @@ class ComputadorController extends Controller | @@ -183,8 +184,6 @@ class ComputadorController extends Controller | ||
183 | $this->getDoctrine()->getManager()->persist( $computador ); | 184 | $this->getDoctrine()->getManager()->persist( $computador ); |
184 | $this->getDoctrine()->getManager()->flush(); | 185 | $this->getDoctrine()->getManager()->flush(); |
185 | 186 | ||
186 | - throw $this->createNotFoundException( 'Computador não encontrado' ); | ||
187 | - | ||
188 | return $this->redirect($this->generateUrl('cacic_computador_coletar') ); | 187 | return $this->redirect($this->generateUrl('cacic_computador_coletar') ); |
189 | } | 188 | } |
190 | 189 |