We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 5dce08d0 authored by mattl's avatar mattl

Add Profile::ensureCurrent() to verify we _certainly_ got a Profile.

parent f10625f8
......@@ -1628,6 +1628,15 @@ class Profile extends Managed_DataObject
return $profile;
static function ensureCurrent()
$profile = self::current();
if (!$profile instanceof Profile) {
throw new AuthorizationException('A currently scoped profile is required.');
return $profile;
* Magic function called at serialize() time.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment