Skip to content

Commit 4588ed5

Browse files
authored
Avoid NPE, profileFileSupplier can be null for tests (#5314)
1 parent 73694a7 commit 4588ed5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/endpoints/UseGlobalEndpointResolver.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ private static String envVarSetting() {
8282

8383
private String profileFileSetting(Supplier<ProfileFile> profileFileSupplier, Supplier<String> profileNameSupplier) {
8484
try {
85+
if (profileFileSupplier == null || profileNameSupplier == null) {
86+
return null;
87+
}
8588
ProfileFile profileFile = profileFileSupplier.get();
8689
String profileName = profileNameSupplier.get();
8790
if (profileFile == null || profileName == null) {

0 commit comments

Comments
 (0)