added null checks
This commit is contained in:
parent
551c3ec923
commit
d22533c2d1
|
@ -273,12 +273,12 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public List<Feed> getRecentFeedsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException {
|
public List<Feed> getRecentFeedsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
|
List<Feed> feeds = new ArrayList<>();
|
||||||
if (timeInMillis > now.getTime())
|
if (timeInMillis > now.getTime())
|
||||||
throw new IllegalArgumentException("the timeInMillis must be before today");
|
throw new IllegalArgumentException("the timeInMillis must be before today");
|
||||||
List<Post> posts = getRecentPostsByUserAndDate(userid, timeInMillis);
|
List<Post> posts = getRecentPostsByUserAndDate(userid, timeInMillis);
|
||||||
if(posts!=null){
|
if(posts!=null){
|
||||||
_log.info("Length of posts is " + posts.size());
|
_log.info("Length of posts is " + posts.size());
|
||||||
List<Feed> feeds = new ArrayList<>();
|
|
||||||
for(Post post: posts){
|
for(Post post: posts){
|
||||||
_log.info(post.toString());
|
_log.info(post.toString());
|
||||||
feeds.add(post2feed(post));
|
feeds.add(post2feed(post));
|
||||||
|
|
Loading…
Reference in New Issue