Commit 44a6f91
Don't throw NPE on GoogleCredential.Builder when scopes not set
The list of account scopes in the GoogleCredential.Builder starts off
uninitialized (i.e. null), meaning that calling the .build() method
throws an NPE unless setServiceAccountScopes() is called. There are no
other fields in the builder that are required to be called, and this
doesn't seem to be required intentionally, so make the Builder resilient
to it being null and have it correctly interpret that as an empty list
of scopes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=1335872731 parent 9b18d3b commit 44a6f91
File tree
2 files changed
+22
-1
lines changed- google-api-client/src
- main/java/com/google/api/client/googleapis/auth/oauth2
- test/java/com/google/api/client/googleapis/auth/oauth2
2 files changed
+22
-1
lines changedgoogle-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
136 | 154 | | |
137 | 155 | | |
138 | 156 | | |
| |||
0 commit comments