Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow credential without explicit expire time
Certain sites provide an access token without an expiration. Currently this causes a NullPointerException. This change is to allow valid credentials that don't have an expiry.
  • Loading branch information
galacticvac authored Feb 4, 2017
commit 98dd8acb05bd5866c837473efff586454b6c9e46
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public Credential authorize(String userId) throws IOException {
try {
Credential credential = flow.loadCredential(userId);
if (credential != null
&& (credential.getRefreshToken() != null || credential.getExpiresInSeconds() > 60)) {
&& (credential.getRefreshToken() != null ||
credential.getExpiresInSeconds() == null ||
credential.getExpiresInSeconds() > 60)) {
return credential;
}
// open in browser
Expand Down