summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-07-13 10:51:25 -0400
committerEvan Prodromou <evan@status.net>2010-07-13 10:51:25 -0400
commitdfd65a4290c7c2f6137d5508597189c4202bfaee (patch)
tree48ab813259bd90ecf1c2b519066332eb287702c3 /classes/Notice.php
parentab149755b62aaf7959a97e4a425e20aebf4c92cc (diff)
push exception on missing profile down to Notice::getProfile()
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 482bc550b..ae7e2e540 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -90,7 +90,13 @@ class Notice extends Memcached_DataObject
function getProfile()
{
- return Profile::staticGet('id', $this->profile_id);
+ $profile = Profile::staticGet('id', $this->profile_id);
+
+ if (empty($profile)) {
+ throw new ServerException(sprintf(_('No such profile (%d) for notice (%d)'), $this->profile_id, $this->id));
+ }
+
+ return $profile;
}
function delete()