Skip to content

Commit f726978

Browse files
committed
Fixed a potential null pointer exception.
1 parent 0de5a71 commit f726978

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

google-auth-library-java/cab-token-generator/java/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactory.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,10 @@ class RefreshTask extends AbstractFuture<IntermediateCredentials> implements Run
503503
finishRefreshTask(task);
504504
RefreshTask.this.set(Futures.getDone(task));
505505
} catch (ExecutionException e) {
506-
RefreshTask.this.setException(e.getCause());
507-
} catch (Exception e) {
508-
RefreshTask.this.setException(e);
506+
Throwable cause = e.getCause();
507+
RefreshTask.this.setException(cause != null ? cause : e);
508+
} catch (Throwable t) {
509+
RefreshTask.this.setException(t);
509510
}
510511
},
511512
MoreExecutors.directExecutor());

0 commit comments

Comments
 (0)