diff --git a/classes/Notice.php b/classes/Notice.php index a1750dda4d..6ed4b34afa 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -218,7 +218,12 @@ class Notice extends Managed_DataObject public static function getByUri($uri) { - return static::getKV('uri', $uri); + $notice = new Notice(); + $notice->uri = $uri; + if (!$notice->find(true)) { + throw new NoResultException($notice); + } + return $notice; } /**