Support: Check ticket for existence before showing

This commit is contained in:
Maxim Leshchenko 2021-12-10 15:53:39 +02:00
parent bdf97e4286
commit 763c0c91e2
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE

View file

@ -169,6 +169,10 @@ final class SupportPresenter extends OpenVKPresenter
{
$this->assertPermission('openvk\Web\Models\Entities\TicketReply', 'write', 0);
$ticket = $this->tickets->get($id);
if(!$ticket || $ticket->isDeleted() != 0)
$this->notFound();
$ticketComments = $this->comments->getCommentsById($id);
$this->template->ticket = $ticket;
$this->template->comments = $ticketComments;