Edge Case Handling
Detects potential null dereferences and missing validation in added code.
Why this rule exists
Most production NullReferenceExceptions come from added code that assumes non-null inputs without guarding for them. The cost of one guard clause is a few characters; the cost of a missing one is a 2 a.m. alert.
Code example
+ public string FormatName(User user) => user.FirstName + " " + user.LastName;+ public string FormatName(User user)
+ {
+ ArgumentNullException.ThrowIfNull(user);
+ return $"{user.FirstName} {user.LastName}";
+ }Configuration
Disable or adjust the severity of this rule in .gauntletci.json:
{
"rules": {
"GCI0006": { "enabled": true, "severity": "Warn" }
}
}See Configuration for the full schema.
Related rules
Behavioral Change Detection
Detects removed logic (Warn), incompatible method signature changes (Block), backward-compatible extensions (Info), and cryptographic boundary changes (Block).
Nullability and Type Safety
Detects null-forgiving operator (!) overuse, pragma warning disables for nullable, and unchecked as-casts that bypass the type system.
Error Handling Integrity
Detects swallowed exceptions (empty catch blocks) and exception handling patterns that hide failures from callers and operators.
Discussed in
Why Tests Miss Bugs
Tests pass but bugs still reach production. The categories of risk that escape test suites and why a green build is not the same as safe code.
How Azure SDK PR #57223 Introduced 6,650+ Unique Risk Signals
Azure SDK PR #57223 generated 6,650+ unique behavioral risk signals across 3 framework versions. See why traditional tools missed them.
Google API PR #3150 Analysis
Behavioral risk analysis of a major Google API library pull request.
gRPC .NET PR #2531 Analysis
Behavioral risk signals in a fundamental RPC framework pull request.
AngleSharp PR #1159 Analysis
HTML parser library pull request introducing behavioral changes.
State of Behavioral Change Risk in .NET
A field report from 610 merged C# PRs across 61 repositories, with raw findings, high-confidence findings, and outlier disclosure.
Real-world evidence
Implemented in src/GauntletCI.Core/Rules/Implementations/GCI0006_*.cs.
Eric Cogen -- Founder, GauntletCI
Twenty years as a senior technical consultant building and modernizing enterprise platforms across .NET, AWS, serverless, microservices, and AI-driven systems.
