Fix nil pointer panic when notifier Send returns nil result
Guard against nil result before accessing result.Error in processNotification, and add NtfyNotifier.Validate override so DefaultTopic is considered before rejecting notifications with zero recipients. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -243,9 +243,11 @@ func (s *NotificationService) processNotification(ctx context.Context, msg *doma
|
||||
|
||||
// Send the notification
|
||||
result, err := notifier.Send(ctx, notification)
|
||||
if err != nil || !result.Success {
|
||||
if err != nil || result == nil || !result.Success {
|
||||
notification.RetryCount++
|
||||
notification.LastError = result.Error
|
||||
if result != nil {
|
||||
notification.LastError = result.Error
|
||||
}
|
||||
if err != nil {
|
||||
notification.LastError = err.Error()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user