added null checks

This commit is contained in:
Ahmed Salah Tawfik Ibrahim 2024-04-12 11:23:40 +02:00
parent 551c3ec923
commit d22533c2d1
1 changed files with 1 additions and 1 deletions

View File

@ -273,12 +273,12 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
@Deprecated
public List<Feed> getRecentFeedsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException {
Date now = new Date();
List<Feed> feeds = new ArrayList<>();
if (timeInMillis > now.getTime())
throw new IllegalArgumentException("the timeInMillis must be before today");
List<Post> posts = getRecentPostsByUserAndDate(userid, timeInMillis);
if(posts!=null){
_log.info("Length of posts is " + posts.size());
List<Feed> feeds = new ArrayList<>();
for(Post post: posts){
_log.info(post.toString());
feeds.add(post2feed(post));