Skip to content

Commit 91beff9

Browse files
committed
Fix attempt to read property on null error.
1 parent fbcbfc8 commit 91beff9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

VATGER/Auth/Service/VatgerModerationLog/CreatorService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private function shouldIgnore(): bool {
185185
/** @var string[] $ignoreThreads */
186186
$ignoreThreads = $this->app->options()['vatger_logging_ignore_threads'];
187187

188-
if ($this->thread !== null) {
188+
if ($this->thread?->Forum !== null) {
189189
$threadIdStr = strval($this->thread->Forum->node_id);
190190

191191
// Check if we're ignoring the forum!
@@ -194,13 +194,13 @@ private function shouldIgnore(): bool {
194194
}
195195
}
196196

197-
if ($this->post !== null) {
197+
if ($this->post?->Thread !== null) {
198198
$threadIdStr = strval($this->post->Thread->thread_id);
199199
if (array_find($ignoreThreads, fn($ignoreId) => $threadIdStr === $ignoreId)) {
200200
return true;
201201
}
202202

203-
$forumIdStr = strval($this->post->Thread->Forum->node_id);
203+
$forumIdStr = strval($this->post->Thread->Forum?->node_id);
204204
if (array_find($ignoreForums, fn($ignoreId) => $forumIdStr === $ignoreId)) {
205205
return true;
206206
}

VATGER/Auth/addon.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"legacy_addon_id": "",
33
"title": "VATSIM Germany",
44
"description": "The VATSIM Germany plugin integrates with VATGER's OAuth2 implementation to allow SSO login in Xenforo.",
5-
"version_id": 150,
6-
"version_string": "1.5.0",
5+
"version_id": 151,
6+
"version_string": "1.5.1",
77
"dev": "VATSIM Germany",
88
"dev_url": "https://vatsim-germany.org",
99
"faq_url": "",

0 commit comments

Comments
 (0)