Fixed XF\Api\Controller\Alert :: assertViewableAlert has two coding errors

Affected version
2.2.1

DragonByte Tech

Well-known member
This block of code:
PHP:
        if ($alert->alerted_user_id != \XF::visitor()->user_id)
        {
            throw $this->notFound();
        }

        if (!$alert->canView())
        {
            throw $this->noPermission();
        }

Produces hard errors when viewed in phpStorm:

1603746862872.png


1603746879910.png

From what I can tell, phpStorm is accurate in its analysis. I believe both notFound and noPermission should be surrounded by $this->exception().
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.2).

Change log:
Throw exceptions correctly in the alert API controller.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top