Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid NPE when processing response message in unit tests
The CoapAsyncRequestObserver spawns a cleaning task when an outbound message is ready to be sent. When invoking the onResponse method in a unit test to trigger the processing of an incoming response, a NPE is thrown if onReadyToSend has not been invoked before. All other methods use the private cancelCleaningTask method to stop the cleaning task which performs a non-null check before stopping the task. The onResponse method has been changed to also use this method in order to prevent the NPE. Signed-off-by: Kai Hudalla <kai.hudalla@bosch.io>
- Loading branch information
1 parent
d33516e
commit afc43f2
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters