HADOOP-15291. TestMiniKdc fails on Java 9

Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
Takanobu Asanuma 2018-03-06 06:01:33 -08:00 committed by Akira Ajisaka
parent 12ecb55ffe
commit e6f99e205b
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
1 changed files with 2 additions and 1 deletions

View File

@ -165,7 +165,8 @@ public class TestMiniKdc extends KerberosSecurityTestcase {
loginContext.logout(); loginContext.logout();
} finally { } finally {
if (loginContext != null) { if (loginContext != null && loginContext.getSubject() != null
&& !loginContext.getSubject().getPrincipals().isEmpty()) {
loginContext.logout(); loginContext.logout();
} }
} }