forked from Archives/Athou_commafeed
Merge pull request #411 from MageFroh/null-ptr-fix
Fix null ptr exception in feed/get/{id} rest call when all entries are read
This commit is contained in:
@@ -308,6 +308,9 @@ public class FeedREST extends AbstractResourceREST {
|
|||||||
return Response.status(Status.NOT_FOUND).build();
|
return Response.status(Status.NOT_FOUND).build();
|
||||||
}
|
}
|
||||||
Long unreadCount = feedSubscriptionService.getUnreadCount(getUser()).get(id);
|
Long unreadCount = feedSubscriptionService.getUnreadCount(getUser()).get(id);
|
||||||
|
if (unreadCount == null) {
|
||||||
|
unreadCount = new Long(0);
|
||||||
|
}
|
||||||
return Response.ok(
|
return Response.ok(
|
||||||
Subscription.build(sub, applicationSettingsService.get()
|
Subscription.build(sub, applicationSettingsService.get()
|
||||||
.getPublicUrl(), unreadCount)).build();
|
.getPublicUrl(), unreadCount)).build();
|
||||||
|
|||||||
Reference in New Issue
Block a user