Skip to content

Commit e28272a

Browse files
authored
fix: harden lookup of credentials id_token attribute (#434)
1 parent 5950e2b commit e28272a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

google/cloud/firestore_v1/base_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ def _emulator_channel(self, transport):
180180
# https://github.com/googleapis/python-firestore/issues/359
181181
# Default the token to a non-empty string, in this case "owner".
182182
token = "owner"
183-
if self._credentials is not None and self._credentials.id_token is not None:
183+
if (
184+
self._credentials is not None
185+
and getattr(self._credentials, "id_token", None) is not None
186+
):
184187
token = self._credentials.id_token
185188
options = [("Authorization", f"Bearer {token}")]
186189

0 commit comments

Comments
 (0)