title: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.facebook.Profile.getFirstName()'
body: <p>I am trying to fetch some data on my android validation using Facebook API. I am able to login into my facebook account. This is the permission I have set to fetch data from Facebook account</p>
  
  <pre><code>loginButton.setReadPermissions(Arrays.asList( "public_profile", "email", "user_birthday", "user_friends"));
  </code></pre>
  
  <p>using the above permissions I am trying to fetch profile name and other data I am getting a null pointer exception with the below code snippet</p>
  
  <pre><code>public void getFacebookData(AccessToken accessToken, Profile profile) {
          System.out.println("---------------------");
          System.out.println("--Facebook Login Successful!");
          System.out.println("--Logged in user Details : ");
          System.out.println("---------------------");
          System.out.println("--User ID : " + accessToken.getUserId());
          System.out.println("--Authentication Token : " + accessToken.getToken());
          System.out.println("---------------------");
          System.out.println("--First Name : " + profile.getFirstName());
          System.out.println("--Last Name : " + profile.getLastName());
          System.out.println("--URL Perfil: " + profile.getLinkUri());
          System.out.println("--URL Imagem: " + profile.getProfilePictureUri(500, 500));
          System.out.println("---------------------");
          System.out.println("--ID : " + profile.getId());
          System.out.println("--Name : " + profile.getName());
          System.out.println("---------------------");
  
          TextView profile_name = (TextView)findViewById(R.id.profile);
          profile_name.setText(profile.getName());
  </code></pre>
  
  <p>Please, what be wrong with the approach I am using.</p>