Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

fix: fix watchdog NPE red herring #1344

Merged
merged 4 commits into from Apr 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions gax/src/main/java/com/google/api/gax/rpc/Watchdog.java
Expand Up @@ -296,6 +296,12 @@ public void onCompleteImpl() {
* @return True if the stream was canceled.
*/
boolean cancelIfStale() {
// If the stream hasn't started yet, innerController will be null. Skip the check this time
// and return false so the stream is still watched.
if (innerController == null) {
return false;
}

Throwable myError = null;

synchronized (lock) {
Expand Down