You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by arunmahadevan <gi...@git.apache.org> on 2018/01/19 19:04:13 UTC

[GitHub] storm pull request #2519: STORM-2903: Fix possible NullPointerException in A...

Github user arunmahadevan commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2519#discussion_r162705370
  
    --- Diff: external/storm-autocreds/src/main/java/org/apache/storm/common/AbstractAutoCreds.java ---
    @@ -215,9 +215,17 @@ private void addTokensToUGI(Subject subject) {
                         if (allTokens != null) {
                             for (Token<? extends TokenIdentifier> token : allTokens) {
                                 try {
    +
    +                                if (token == null) {
    +                                    LOG.debug("Ignoring null token");
    +                                    continue;
    +                                }
    +
                                     LOG.debug("Current user: {}", UserGroupInformation.getCurrentUser());
    -                                LOG.debug("Token from credential: {} / {}", token.toString(),
    -                                        token.decodeIdentifier().getUser());
    +                                LOG.debug("Token from Credentials : {}", token);
    +
    +                                if (token.decodeIdentifier() != null)
    --- End diff --
    
    @omkreddy , toString already handles it and just printing the token would take care of decoding and printing the user information.
    https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java#L429


---