mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix notification nullpointer
This commit is contained in:
@@ -98,7 +98,9 @@ class UserRegistration extends Notification
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
$slackUrl = (string)app('preferences')->getForUser(auth()->user(), 'slack_webhook_url', '')->data;
|
||||
/** @var User|null $user */
|
||||
$user = auth()->user();
|
||||
$slackUrl = null === $user ? '' : (string)app('preferences')->getForUser(auth()->user(), 'slack_webhook_url', '')->data;
|
||||
if (str_starts_with($slackUrl, 'https://hooks.slack.com/services/')) {
|
||||
return ['mail', 'slack'];
|
||||
}
|
||||
|
Reference in New Issue
Block a user