diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index 03bec00e..5480b522 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -654,10 +654,14 @@ class Code extends Controller for ($i = 0; $i < $history_count; $i++) { $h = $history[$i]; - if (array_key_exists ($h['author'], $stats)) - $stats[$h['author']]++; - else - $stats[$h['author']] = 1; + if (array_key_exists ('author', $h)) + { + $author = $h['author']; + if (array_key_exists ($author, $stats)) + $stats[$author]++; + else + $stats[$author] = 1; + } } $this->load->library ('PHPGraphLibPie', array ('width' => 400, 'height' => 300), 'graph'); @@ -673,10 +677,14 @@ class Code extends Controller for ($i = 0; $i < $history_count; $i++) { $h = $history[$i]; - if (array_key_exists ($h['author'], $stats)) - $stats[$h['author']]++; - else - $stats[$h['author']] = 1; + if (array_key_exists ('author', $h)) + { + $author = $h['author']; + if (array_key_exists ($author, $stats)) + $stats[$author]++; + else + $stats[$author] = 1; + } } $this->load->library ('PHPGraphLib', array ('width' => 400, 'height' => 300), 'graph');