From 08fc74b42542c76ce9c532043353ae8bcb44106e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 12 May 2006 05:53:25 +0000 Subject: [PATCH] r827: Wrap the assignedto fetching in conditionals --- showhistory.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/showhistory.php b/showhistory.php index ab71363..c006276 100644 --- a/showhistory.php +++ b/showhistory.php @@ -135,17 +135,23 @@ foreach ($logs AS $dateline => $logitems) } else if ($matches[1] == 'assignto' OR $matches[1] == 'assignedto') { - $user = new UserAPI($bugsys); - $user->set('userid', $log['original']); - $user->set_condition(); - $user->fetch(); - $log['original'] = construct_user_display($user->objdata); + if ($log['original']) + { + $user = new UserAPI($bugsys); + $user->set('userid', $log['original']); + $user->set_condition(); + $user->fetch(); + $log['original'] = construct_user_display($user->objdata); + } - $user = new UserAPI($bugsys); - $user->set('userid', $log['changed']); - $user->set_condition(); - $user->fetch(); - $log['changed'] = construct_user_display($user->objdata); + if ($log['changed']) + { + $user = new UserAPI($bugsys); + $user->set('userid', $log['changed']); + $user->set_condition(); + $user->fetch(); + $log['changed'] = construct_user_display($user->objdata); + } } } -- 2.22.5