handled a corner case of no author in the code history
This commit is contained in:
		| @ -654,10 +654,14 @@ class Code extends Controller | |||||||
| 			for ($i = 0; $i < $history_count; $i++) | 			for ($i = 0; $i < $history_count; $i++) | ||||||
| 			{ | 			{ | ||||||
| 				$h = $history[$i]; | 				$h = $history[$i]; | ||||||
| 				if (array_key_exists ($h['author'], $stats)) | 				if (array_key_exists ('author', $h)) | ||||||
| 					$stats[$h['author']]++; | 				{ | ||||||
|  | 					$author = $h['author']; | ||||||
|  | 					if (array_key_exists ($author, $stats)) | ||||||
|  | 						$stats[$author]++; | ||||||
| 					else  | 					else  | ||||||
| 					$stats[$h['author']] = 1; | 						$stats[$author] = 1; | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			$this->load->library ('PHPGraphLibPie', array ('width' => 400, 'height' => 300), 'graph'); | 			$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++) | 			for ($i = 0; $i < $history_count; $i++) | ||||||
| 			{ | 			{ | ||||||
| 				$h = $history[$i]; | 				$h = $history[$i]; | ||||||
| 				if (array_key_exists ($h['author'], $stats)) | 				if (array_key_exists ('author', $h)) | ||||||
| 					$stats[$h['author']]++; | 				{ | ||||||
|  | 					$author = $h['author']; | ||||||
|  | 					if (array_key_exists ($author, $stats)) | ||||||
|  | 						$stats[$author]++; | ||||||
| 					else  | 					else  | ||||||
| 					$stats[$h['author']] = 1; | 						$stats[$author] = 1; | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			$this->load->library ('PHPGraphLib', array ('width' => 400, 'height' => 300), 'graph'); | 			$this->load->library ('PHPGraphLib', array ('width' => 400, 'height' => 300), 'graph'); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user