From 0ef422593ba351d363c584ad781ff92548bc6e9b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 2 Sep 2010 15:39:22 -0700 Subject: Don't explode if we fail to load a listed attachment id in Notice::attachments() --- classes/Notice.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index 0eeebfadf..b991ecbd3 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -578,7 +578,9 @@ class Notice extends Memcached_DataObject if ($f2p->find()) { while ($f2p->fetch()) { $f = File::staticGet($f2p->file_id); - $att[] = clone($f); + if ($f) { + $att[] = clone($f); + } } } return $att; -- cgit v1.2.3-54-g00ecf