Skip navigation
5102 Views 4 Replies Latest reply: Sep 9, 2009 4:16 AM by Guenther Niess RSS
Ondřej Žižka Bronze 8 posts since
Jan 30, 2009
Currently Being Moderated

Feb 1, 2009 9:59 AM

Smack - fix for NPE in SASLMechanism.java

I was getting NPE from Base64.encodeBytes(), as response was null.

 

So in SASLMechanism.java at line 154, I replaced

 

        String authenticationText = Base64.encodeBytes(response,Base64.DONT_BREAK_LINES);
        if(authenticationText.equals("")) {
            authenticationText = "=";
        }

 

with

 

        String authenticationText = "";
        if( null != response ){
          authenticationText = Base64.encodeBytes(response, Base64.DONT_BREAK_LINES);
        }
        if(authenticationText.equals("")) {
            authenticationText = "=";
        }

 

and now authentization works.

 

Ondra Zizka

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points