Announcement Announcement Module
Collapse
No announcement yet.
Post.getLikeCount() throws NPE on post with no likes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    I'll look into it, but before I do...can you confirm that you're using the latest snapshot builds when seeing this?

    Comment


    • #3
      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 <[email protected]>
      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$

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment

          Working...
          X