-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
731: Fix NPE in WebSocketClient if an error occurs during connection #783
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Any test coming for this?
Although WebSocketClientTest.java already tests the functionality I added a dedicated test for the case where the listener is not set. |
…fix/731-npe-websocket-client # Conflicts: # core/src/main/java/org/web3j/protocol/websocket/WebSocketClient.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. You have some checkstyle errors - you can see them locally with ./gradlew check
Codecov Report
@@ Coverage Diff @@
## release/4.0 #783 +/- ##
=================================================
+ Coverage 77.24% 77.25% +0.01%
- Complexity 1849 1850 +1
=================================================
Files 241 241
Lines 6815 6818 +3
Branches 1012 1012
=================================================
+ Hits 5264 5267 +3
Misses 1301 1301
Partials 250 250
Continue to review full report at Codecov.
|
What does this PR do?
Addresses the case where WebSocketClient is used without a listener.
Where should the reviewer start?
WebSocketClient.
Why is it needed?
To safeguard against NPEs, and to address an issue raised via another PR: #731