mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
fix null ptr exception in feed/get/{id} rest call when all entries are read
- map of the unread counts does not contain any element for the feed if no entry is unread, leading to a null pointer exception when building the response - problem occurs for example when showing the feed details and all entries are read: all fields are blank
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