sometimes when looking for next/prev the image doesn't exist
This commit is contained in:
parent
0a4e8e05f0
commit
9d36a6a1bb
@ -87,6 +87,10 @@ class ViewImage extends SimpleExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$image = Image::by_id($image_id);
|
$image = Image::by_id($image_id);
|
||||||
|
if(is_null($image)) {
|
||||||
|
$this->theme->display_error($page, "Image not found", "Image $image_id could not be found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if($event->page_matches("post/next")) {
|
if($event->page_matches("post/next")) {
|
||||||
$image = $image->get_next($search_terms);
|
$image = $image->get_next($search_terms);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user