From e6c9a7d1b47eb7519260514d00eb0420c55a1041 Mon Sep 17 00:00:00 2001 From: Tim Steiner <tsteiner2@unl.edu> Date: Mon, 18 Oct 2010 18:34:40 +0000 Subject: [PATCH] Avoid throwing a fatal error when viewing a UCC report for a month where at least one of the votes has not yet finished. --- application/modules/ucc/controllers/ReportsController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/modules/ucc/controllers/ReportsController.php b/application/modules/ucc/controllers/ReportsController.php index 3ca87dc7..4acebf82 100644 --- a/application/modules/ucc/controllers/ReportsController.php +++ b/application/modules/ucc/controllers/ReportsController.php @@ -152,6 +152,11 @@ class Ucc_ReportsController extends App_Controller_Action $time = $aHistory->getTime(); $voteResult = $aHistory->getDecision(); } + + // If we couldn't find a time in the history, this $approvalAction hasn't happened yet, so continue on. + if (!$time) { + continue; + } if (!$originalCourse) { $originalCourse = $currentCourse; @@ -163,6 +168,7 @@ class Ucc_ReportsController extends App_Controller_Action $voteResult = $approvalAction->tallyVotes($votes); } + $data[] = new Unl_Model_Array(array( 'time' => $time->getTimestamp(), 'college' => $originalCourse->getCollege(), -- GitLab