diff --git a/src/main/java/org/opensearch/security/filter/SecurityRestFilter.java b/src/main/java/org/opensearch/security/filter/SecurityRestFilter.java index f4634a1d8a..effbe1d058 100644 --- a/src/main/java/org/opensearch/security/filter/SecurityRestFilter.java +++ b/src/main/java/org/opensearch/security/filter/SecurityRestFilter.java @@ -132,10 +132,6 @@ public RestHandler wrap(RestHandler original, AdminDNs adminDNs) { return (request, channel, client) -> { org.apache.logging.log4j.ThreadContext.clearAll(); User user = threadContext.getTransient(ConfigConstants.OPENDISTRO_SECURITY_USER); - if (user == null) { - // Should not happen - return; - } boolean isSuperAdminUser = userIsSuperAdmin(user, adminDNs); if (isSuperAdminUser || (whitelistingSettings.checkRequestIsAllowed(request, channel)