Skip to content

Commit

Permalink
Bug fix: added 404 for legislation/view when missing ID
Browse files Browse the repository at this point in the history
  • Loading branch information
inghamn committed May 18, 2020
1 parent fba3b9a commit 3c16e4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Application/Controllers/LegislationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ public function years(): View

public function view(): View
{
try { $legislation = new Legislation($_GET['legislation_id']); }
catch (\Exception $e) { $_SESSION['errorMesssages'][] = $e; }
if (!empty($_GET['legislation_id'])) {
try { $legislation = new Legislation($_GET['legislation_id']); }
catch (\Exception $e) { $_SESSION['errorMesssages'][] = $e; }
}

if (isset($legislation)) {
$committee = $legislation->getCommittee();
Expand Down

0 comments on commit 3c16e4f

Please sign in to comment.