forked from Cavemanon/cavepaintings
React appropriately when there are no random list search results
This commit is contained in:
@ -44,8 +44,11 @@ class RandomList extends Extension {
|
||||
$random_images = array();
|
||||
|
||||
// generate random images
|
||||
for ($i = 0; $i < $images_per_page; $i++)
|
||||
array_push($random_images, Image::by_random($search_terms));
|
||||
for ($i = 0; $i < $images_per_page; $i++) {
|
||||
$random_image = Image::by_random($search_terms);
|
||||
if (!$random_image) continue;
|
||||
array_push($random_images, $random_image);
|
||||
}
|
||||
|
||||
$this->theme->set_page($search_terms);
|
||||
$this->theme->display_page($page, $random_images);
|
||||
|
Reference in New Issue
Block a user