Closed Ark4ne closed 9 years ago
I just start with Jumblr and i got an error ( NullPointer ) when i reblog a post.
The problem happens because we try to parse the json object "post" while one recovers only the new post id.
I made two changes:
public Post postReblog(String blogName, Long postId, String reblogKey, Map<String, ?> options) { if (options == null) { options = new HashMap<String, String>(); } Map<String, Object> soptions = JumblrClient.safeOptionMap(options); soptions.put("id", postId.toString()); soptions.put("reblog_key", reblogKey); // Edit here Long id = requestBuilder.post(JumblrClient.blogPath(blogName, "/post/reblog"), soptions).getIdFromReblog(); return this.blogPost(blogName, id); }
public Long getIdFromReblog() { Gson gson = gsonParser(); JsonObject object = (JsonObject) response; return gson.fromJson(object.get("id").toString(), Long.class); }
And the probleme has been solved ;)
Would you be willing to do a patch and some tests to get this pulled into the client? We're happy to take a PR!
This error is still within the current version of jumblr.
I just start with Jumblr and i got an error ( NullPointer ) when i reblog a post.
The problem happens because we try to parse the json object "post" while one recovers only the new post id.
I made two changes:
JumblrClient.java : Edit postReblog()
ResponseWrapper.java : Add getIdFromReblog()
And the probleme has been solved ;)