From d22533c2d1f6995ff27c1beddff87b5232bcac29 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Fri, 12 Apr 2024 11:23:40 +0200 Subject: [PATCH] added null checks --- .../gcube/portal/databook/server/DBCassandraAstyanaxImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java index bf627d2..2bf47e4 100644 --- a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java +++ b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java @@ -273,12 +273,12 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { @Deprecated public List getRecentFeedsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException { Date now = new Date(); + List feeds = new ArrayList<>(); if (timeInMillis > now.getTime()) throw new IllegalArgumentException("the timeInMillis must be before today"); List posts = getRecentPostsByUserAndDate(userid, timeInMillis); if(posts!=null){ _log.info("Length of posts is " + posts.size()); - List feeds = new ArrayList<>(); for(Post post: posts){ _log.info(post.toString()); feeds.add(post2feed(post));