added null checks
This commit is contained in:
parent
551c3ec923
commit
d22533c2d1
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue