Missing null checks
See original GitHub issueI’m playing around with nullable reference types in this branch. So far I’ve found several places that could benefit from an extra null check.
I’ll try to keep the branch in sync with master as the null checks are merged.
ReferenceTypeAssertions
BeAssignableTo
BeAssignableTo<T>
null Subject
ComparableTypeAssertions
Be
null Subject
NumericAssertions
BeOfType
NotBeOfType
null Subject
ActionAssertions
NotThrow
InvokeSubjectWithInterception (public methods that calls it)
null Subject
AsyncFunctionAssertions
NotThrow
NotThrowAsync
NotThrow<TException>
NotThrowAsync<TException>
InvokeSubjectWithInterception (public methods that calls it)
InvokeSubjectWithInterceptionAsync (public methods that calls it)
null Subject
FunctionAssertions
NotThrow
NotThrow<TException>
InvokeSubjectWithInterception (public methods that calls it)
NotThrowAfter
null Subject
AssemblyAssertions
DefineType
null Subject
Reference
NotReference
null Subject
null assembly
ExecutionTimeAssertions
ctor
null action
null Func<T>
Issue Analytics
- State:
- Created 4 years ago
- Comments:25 (25 by maintainers)
Top Results From Across the Web
Missing Check against Null - java
If this code is going to be invoked during a HTTP request, all these null checks are junk. There isn't a valid state...
Read more >Unchecked Return Value Missing Check against Null
Ignoring a method's return value can cause the program to overlook unexpected states and conditions. Just about every serious attack on a software...
Read more >Avoid Check for Null Statement in Java
Learn several strategies for avoiding the all-too-familiar boilerplate conditional statements to check for null values in Java.
Read more >Should one check for null if he does not expect null?
On one side, checking for null where you are not expecting it (i.e. have no user interface to handle it) is, in my...
Read more >Why I never null-check parameters - The New Java Developer
The simple reason to check for nulls is the fear of the NullPointerException , ingrained in every Java developer. There is a famous...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, that were only 50 methods (excluding overloads)… pfff
32 NullReferenceExceptions.txt