Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

oauthutil: fix nil pointer crash when started with expired token

Nick Craig-Woodd3e3af377a66
diff --git a/lib/oauthutil/renew.go b/lib/oauthutil/renew.go
index e3652ee9c..40eab7843 100644
--- a/lib/oauthutil/renew.go
+++ b/lib/oauthutil/renew.go
@@ -88,7 +88,9 @@ func (r *Renew) Shutdown() {
}
// closing a channel can only be done once
r.shutdown.Do(func() {
- r.ts.expiryTimer.Stop()
+ if r.ts != nil {
+ r.ts.expiryTimer.Stop()
+ }
close(r.done)
})
}