Skip to content

Commit ca861c5

Browse files
committed
Added null check to getApiContact
1 parent 7fcd8e6 commit ca861c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/uid2/operator/util/RoutingContextUtil.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ public static String getApiContact(RoutingContext rc, IAuthorizableProvider auth
2020
try {
2121
final String authHeaderValue = rc.request().getHeader("Authorization");
2222
final String authKey = extractBearerToken(authHeaderValue);
23+
if (authKey == null) {
24+
return UNKNOWN;
25+
}
2326
final IAuthorizable profile = authKeyStore.get(authKey);
27+
if (profile == null) {
28+
return UNKNOWN;
29+
}
2430
String apiContact = profile.getContact();
2531
return apiContact == null ? UNKNOWN : apiContact;
2632
} catch (Exception ex) {

0 commit comments

Comments
 (0)