Commit 4f6b8f18 authored by Mark Harding's avatar Mark Harding
Browse files

Merge branch 'fix/null-user-email-setting-872' into 'master'

[Sprint/OldfashionedOwl](fix): Sentry bug - settings emails endpoint null user.

Closes #872

See merge request !346
parents 8a401b6a 400bb77c
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -13,6 +13,12 @@ class emails implements Interfaces\Api
    public function get($pages)
    public function get($pages)
    {
    {
        $user = Core\Session::getLoggedInUser();
        $user = Core\Session::getLoggedInUser();
        if (!$user) {
            return Factory::response([
                'status' => 'error',
                'message' => 'User must be logged in.'
            ]);
        }


        $campaigns = [ 'when', 'with', 'global' ];
        $campaigns = [ 'when', 'with', 'global' ];