diff --git a/pie.php b/pie.php index 0e94bbe9..24afad91 100644 --- a/pie.php +++ b/pie.php @@ -276,7 +276,11 @@ function draw_slices( $x, $y, $angles, $colors ) { $x; //PHPCS $y; //PHPCS - $pie_count = count( $angles ); + if is_null( $angles ) { + $pie_count = 0; + } else { + $pie_count = count( $angles ); + } $PIE_THICKNESS = ($this->diameter * 0.075); for( $j = ($this->center_y+$PIE_THICKNESS); $j > $this->center_y; $j-- ) {