You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With #2765 merged we have a good basis to tighten the codebase by adding more null guards and allowing for less nullability throughout.
Detailed Description
One of the worst exceptions to debug is NullReferenceException. With ArgumentNullException you at least know which argument was null, which is a huge improvement. Better yet is to alleviate null altogether, or at least move all code dealing with null to the perimeter of the codebase. GitVersion.Core should preferably be completely free of nullable types.
Context
We are plagued with NullReferenceException surfacing its ugly head every so often. See #2763, #2605, #2695, #2734, #2825 and #2631 (comment) for examples. We allow null by having default, argument-free constructors in classes with fields that then become uninitialized, for instance. We also are missing null guards in a lot of constructors that take arguments that should not be allowed to be null.
Possible Implementation
Remove default constructors in classes with fields that need initialization. Add null guards throughout the codebase.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.
With #2765 merged we have a good basis to tighten the codebase by adding more
null
guards and allowing for less nullability throughout.Detailed Description
One of the worst exceptions to debug is
NullReferenceException
. WithArgumentNullException
you at least know which argument wasnull
, which is a huge improvement. Better yet is to alleviatenull
altogether, or at least move all code dealing withnull
to the perimeter of the codebase.GitVersion.Core
should preferably be completely free of nullable types.Context
We are plagued with
NullReferenceException
surfacing its ugly head every so often. See #2763, #2605, #2695, #2734, #2825 and #2631 (comment) for examples. We allownull
by having default, argument-free constructors in classes with fields that then become uninitialized, for instance. We also are missingnull
guards in a lot of constructors that take arguments that should not be allowed to benull
.Possible Implementation
Remove default constructors in classes with fields that need initialization. Add
null
guards throughout the codebase.The text was updated successfully, but these errors were encountered: