fix(helpdesk): handle missing session in EffectiveHelpdeskSettingsService

Scheduler jobs run without an active session, causing SessionStore::all()
to fail. Wrap the call in try-catch to fall back to global config (tenant
ID 0) when no session is available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 12:31:38 +02:00
parent 20f582f459
commit 364bda67a9

View File

@@ -188,7 +188,13 @@ class EffectiveHelpdeskSettingsService
private function resolveCurrentTenantId(): int
{
$session = $this->sessionStore->all();
try {
$session = $this->sessionStore->all();
} catch (\Throwable) {
// No active session (e.g. scheduler context) → fall back to global config
return 0;
}
$tenant = $session['current_tenant'] ?? null;
if (!is_array($tenant)) {
return 0;