Fix PermaLink controller error for content without container (#5513)

* Fix PermaLink controller error for content without container

* Update CHANGELOG.md

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Yuriy Bakhtin 2022-02-08 01:23:02 +03:00 committed by GitHub
parent 6e831f5428
commit a282c78b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ HumHub Changelog
-------------------
- Fix #5480: `el` language file in Admin section broken
- Fix #5479: Fix ContentContainerPermissionAccess without provided container
- Fix #5513: Fix PermaLink controller error for content without container
- Fix #5517: Don't send "Follows" notification on request friendship

View File

@ -31,7 +31,7 @@ class PermaController extends Controller
{
$comment = Comment::findOne(['id' => $id]);
if (!$comment || !$comment->canRead()) {
if (!$comment || !$comment->content || !$comment->canRead() || !$comment->content->container) {
throw new NotFoundHttpException();
}