diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-02-22 23:54:48 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-02-22 23:54:48 +0000 |
commit | ffbab952c679ea60bd7de102411e5e8a92896c96 (patch) | |
tree | 39f421097dc47acac7b2a488badcd2bc7313b481 | |
parent | 3a8439d7b504dfa4f1b32e214e74fb842d040983 (diff) |
If the album_cover_item_id points to a missing item (unlikely but possible) just treat it like it was missing and continue
-rw-r--r-- | core/models/item.php | 7 |
1 files changed, 6 insertions, 1 deletions
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; + } } /** |