diff options
Diffstat (limited to 'utils/album.php')
-rw-r--r-- | utils/album.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/album.php b/utils/album.php index 1b6b662..696e75e 100644 --- a/utils/album.php +++ b/utils/album.php @@ -122,10 +122,12 @@ function getRandomPhoto() $numphotos = sizeof($album->photos); $rphoto = rand(0, $numphotos-1); - foreach($album->photos as $p) { - $photo = $p; - $rphoto--; - if(!$rphoto) break; + if($album->photos) { + foreach($album->photos as $p) { + $photo = $p; + $rphoto--; + if(!$rphoto) break; + } } // echo "<p>".$numalbums . " " .$ralbum . " ".$numphotos . " ".$rphoto . "</p>"; |