streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [3/3] git commit: STREAMS-180 | Fixing issue where NPE could be thrown if a post has no comments
Date Tue, 23 Sep 2014 23:09:50 GMT
STREAMS-180 | Fixing issue where NPE could be thrown if a post has no comments


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/8c45159b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/8c45159b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/8c45159b

Branch: refs/heads/master
Commit: 8c45159b0e034c533a6836bc5d23f83a02395af5
Parents: ef2e065
Author: Robert Douglas <rdouglas@w2odigital.com>
Authored: Mon Sep 22 17:23:59 2014 -0500
Committer: Robert Douglas <rdouglas@w2odigital.com>
Committed: Mon Sep 22 17:23:59 2014 -0500

----------------------------------------------------------------------
 .../instagram/serializer/util/InstagramActivityUtil.java      | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8c45159b/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java
b/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java
index 5bbbb35..d41ea93 100644
--- a/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java
+++ b/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java
@@ -322,8 +322,11 @@ public class InstagramActivityUtil {
 
         Comments comments = item.getComments();
         String commentsConcat = "";
-        for(CommentData commentData : comments.getComments()) {
-            commentsConcat += " " + commentData.getText();
+
+        if(comments != null) {
+            for (CommentData commentData : comments.getComments()) {
+                commentsConcat += " " + commentData.getText();
+            }
         }
         if(item.getCaption() != null) {
             commentsConcat += " " + item.getCaption().getText();


Mime
View raw message