Skip to content

Handle nil config gracefully instead of crashing#13

Merged
rosa merged 1 commit intomasterfrom
handle-nil-config
Mar 17, 2026
Merged

Handle nil config gracefully instead of crashing#13
rosa merged 1 commit intomasterfrom
handle-nil-config

Conversation

@rosa
Copy link
Member

@rosa rosa commented Mar 17, 2026

Summary

  • Use safe navigation operator (&.) in Rspamd.setup so a nil config doesn't raise NoMethodError
  • When config is nil, client_for returns ClientStub instances (same as when disabled)
  • Added test covering the nil config case

Test plan

  • New test test_returns_stub_when_config_is_nil passes
  • Verify existing tests still pass

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rosa rosa merged commit cf92800 into master Mar 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant