Skip to content

Commit bdc2f6d

Browse files
Hacky Credentials Fix
1 parent f32c76f commit bdc2f6d

File tree

1 file changed

+8
-0
lines changed
  • google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore

1 file changed

+8
-0
lines changed

google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ public Builder setTimestampsInSnapshotsEnabled(boolean value) {
208208
@Override
209209
@Nonnull
210210
public FirestoreOptions build() {
211+
if (this.credentials == null && this.credentialsProvider != null) {
212+
try {
213+
this.setCredentials(credentialsProvider.getCredentials());
214+
} catch (IOException e) {
215+
throw new RuntimeException("Failed to obtain credentials", e);
216+
}
217+
}
218+
211219
return new FirestoreOptions(this);
212220
}
213221
}

0 commit comments

Comments
 (0)