Browse Source

Added 404 not found exception.

xaav 14 years ago
parent
commit
ba45c15ea9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Packagist/WebBundle/Controller/WebController.php

+ 4 - 0
src/Packagist/WebBundle/Controller/WebController.php

@@ -124,6 +124,10 @@ class WebController extends Controller
             ->getRepository('PackagistWebBundle:Package')
             ->findOneById($id);
 
+        if(empty($package))  {
+            throw new NotFoundHttpException();
+        }
+
         return array('package' => $package);
     }