diff --git a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java index 792609f4b4..2a84403af0 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java +++ b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java @@ -218,7 +218,7 @@ public B setCredentials(Credentials credentials) { } if (this.quotaProjectId == null && credentials instanceof QuotaProjectIdProvider) { - this.quotaProjectId = ((ServiceAccountCredentials) credentials).getQuotaProjectId(); + this.quotaProjectId = ((QuotaProjectIdProvider) credentials).getQuotaProjectId(); } return self(); }