From 9d36a6a1bb53e18c4c1fe6a88628139d6fb92b1e Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 14 Jan 2012 14:38:45 +0000 Subject: [PATCH] sometimes when looking for next/prev the image doesn't exist --- ext/view/main.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/view/main.php b/ext/view/main.php index fc495cbc..427c78a2 100644 --- a/ext/view/main.php +++ b/ext/view/main.php @@ -87,6 +87,10 @@ class ViewImage extends SimpleExtension { } $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")) { $image = $image->get_next($search_terms); }