diff options
| author | Murtaza Sultani <sultani@data-quest.de> | 2025-08-07 11:55:35 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-08-07 11:55:35 +0200 |
| commit | c21b2a599bb5b41c453c7bdf59903fc19d8f3b00 (patch) | |
| tree | 3b3dbaef01a80eac03510cc08bd5c47cc82fc12a | |
| parent | 9b8152b57f26a71143582d3ebd4eee80c2b7405d (diff) | |
Resolve "Forum: PHP-Warning beim freien Veranstaltungen"
Closes #5795
Merge request studip/studip!4419
| -rw-r--r-- | lib/models/Forum/Posting.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/models/Forum/Posting.php b/lib/models/Forum/Posting.php index f8fb579..6961a7b 100644 --- a/lib/models/Forum/Posting.php +++ b/lib/models/Forum/Posting.php @@ -61,7 +61,7 @@ class Posting extends SimpleORMap public function getAuthor(): ?MemberDTO { - if ($this->anonymous && $this->user_id !== User::findCurrent()->user_id) { + if ($this->anonymous && $this->user_id !== User::findCurrent()?->user_id) { return MemberDTO::fromArray(); } @@ -96,7 +96,7 @@ class Posting extends SimpleORMap GROUP BY forum_topics.range_id, forum_discussions.discussion_id"; $params = [ ':range_ids' => $range_ids, - ':user_id' => User::findCurrent()->id, + ':user_id' => User::findCurrent()?->id, ]; $res = \DBManager::get()->fetchAll($query, $params); |
