[solved] When getting scores from Openfeint occurs Fatal Exception


#1

Hello,
I have problem with getting scores for current user.

My code:

Leaderboard easy = new Leaderboard( easyLeaderboardID );
easy.getUserScore( OpenFeint.getCurrentUser(), new Leaderboard.GetUserScoreCB() {           
   @Override public void onSuccess(Score score) {
      Log.w("LEADERBOARD", score.toString());
   }
});

Occurs fatal exception(Null pointer exception) if try to access to score in callback.

My mistake. This is from openfeint help:

NOTE!  If the User has -not- posted a Score to this Leaderboard, your callback's
onSuccess() method will be called with a null Score parameter!

Simply added in onSuccess

if( score != null ) 

Thanks.