Results 1 to 2 of 2

Thread: getLocation() Reference Object null

  1. #1
    Join Date
    Jul 2012
    Posts
    12

    Default getLocation() Reference Object null

    Hi there!

    I'm trying to get a Location Object, but is returning a null object. The code is above:

    FacebookProfile profile = facebook.userOperations().getUserProfile();
    Reference reference = profile.getLocation();

    The error: java.lang.NullPointerException

    If anyone could help, thanks.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,070

    Default

    Well, if you're getting a NPE when calling profile.getLocation() then the profile is null (there's nothing within the getLocation() method that could cause a NPE). But could it be that the NPE happens when trying to get the ID or name from the location Reference? If so, then the location itself is null...and it is possible that a profile not have a location, in which case a null is returned from getLocation().

    I'm afraid that for lack of knowing exactly where the NPE happens, that's the most help I can offer.
    Craig Walls
    Spring Social Project Lead

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •