From ffbab952c679ea60bd7de102411e5e8a92896c96 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 22 Feb 2009 23:54:48 +0000 Subject: If the album_cover_item_id points to a missing item (unlikely but possible) just treat it like it was missing and continue --- core/models/item.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/models') diff --git a/core/models/item.php b/core/models/item.php index da0e7eb3..8898e923 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -275,7 +275,12 @@ class Item_Model extends ORM_MPTT { return null; } - return model_cache::get("item", $this->album_cover_item_id); + try { + return model_cache::get("item", $this->album_cover_item_id); + } catch (Exception $e) { + // It's possible (unlikely) that the item was deleted, if so keep going. + return null; + } } /** -- cgit v1.2.3