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:
@@ -188,7 +188,13 @@ class EffectiveHelpdeskSettingsService
|
||||
|
||||
private function resolveCurrentTenantId(): int
|
||||
{
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user