Browse Source

Added 404 not found exception.

xaav 14 năm trước cách đây
mục cha
commit
ba45c15ea9
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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);
     }