Results 1 to 5 of 5

Thread: Post.getLikeCount() throws NPE on post with no likes

  1. #1
    Join Date
    Feb 2012
    Posts
    29

    Default Post.getLikeCount() throws NPE on post with no likes

    the graph explorer shows this post that returns json that causes a NPE in Post.getLikeCount().
    Code:
    {
      "id": "100003283444808_189987347787379",
      "from": {
        "name": "RobInq BlairInq",
        "id": "100003283444808"
      },
      "message": "more fun",
      "actions": [
        {
          "name": "Comment",
          "link": "http://www.facebook.com/100003283444808/posts/189987347787379"
        },
        {
          "name": "Like",
          "link": "http://www.facebook.com/100003283444808/posts/189987347787379"
        }
      ],
      "privacy": {
        "description": "Public",
        "value": "EVERYONE"
      },
      "type": "status",
      "created_time": "2012-04-12T19:59:28+0000",
      "updated_time": "2012-04-12T19:59:28+0000",
      "comments": {
        "count": 0
      }
    }
    Since it has no likes node, the ReferenceListAndCountDeserializer will return null, making calls that use like throw NPE.
    This is, as they say, a problem.
    Added comments at https://jira.springsource.org/browse/SOCIALFB-41
    Will have to work around it locally for the time.

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

    Default

    I'll look into it, but before I do...can you confirm that you're using the latest snapshot builds when seeing this?
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Feb 2012
    Posts
    29

    Default

    just did a git pull, saw updates to a bunch of docs stuff, but no code changes.
    TwistyWindyPassage:current robblair$ git show
    commit a47f5bb7a295a393bd4dd60d811229cf992a170a
    Merge: 1a5f23b 904111b
    Author: Craig Walls <craig@habuma.com>
    Date: Thu Apr 12 15:02:21 2012 -0700

    Merge pull request #33 from habuma/master

    Updated README to reflect new build process
    and comparing to what I have checked in (using SVN for our local source control, merging vendor to our branch)
    TwistyWindyPassage:spring-social-facebook robblair$ svn status
    ? build
    TwistyWindyPassage:spring-social-facebook robblair$

  4. #4
    Join Date
    Aug 2004
    Posts
    1,075

    Default

    Alright, then I'll have a look. Sounds like a bug to me. Will queue it up on my todo list and let you know.
    Craig Walls
    Spring Social Project Lead

  5. #5
    Join Date
    Aug 2004
    Posts
    1,075

    Default

    Quick update: I just pushed a fix for this into the latest 1.1.0.BUILD-SNAPSHOT build. If no likes information is available, the getLikes() and getLikeCount() methods will return null.
    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
  •