mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
prevent NPE
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -15,7 +15,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<jpa.datasource.name>java:openejb/Resource/My DataSource</jpa.datasource.name>
|
<jpa.datasource.name>java:openejb/Resource/My DataSource</jpa.datasource.name>
|
||||||
<jpa.show_sql>true</jpa.show_sql>
|
<jpa.show_sql>false</jpa.show_sql>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -54,9 +54,11 @@ public class EntriesREST extends AbstractREST {
|
|||||||
if (type == Type.feed) {
|
if (type == Type.feed) {
|
||||||
FeedSubscription subscription = feedSubscriptionService.findById(
|
FeedSubscription subscription = feedSubscriptionService.findById(
|
||||||
getUser(), Long.valueOf(id));
|
getUser(), Long.valueOf(id));
|
||||||
entries.setName(subscription.getTitle());
|
if (subscription != null) {
|
||||||
entries.getEntries().addAll(
|
entries.setName(subscription.getTitle());
|
||||||
buildEntries(subscription, offset, limit, unreadOnly));
|
entries.getEntries().addAll(
|
||||||
|
buildEntries(subscription, offset, limit, unreadOnly));
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -76,13 +78,14 @@ public class EntriesREST extends AbstractREST {
|
|||||||
} else {
|
} else {
|
||||||
FeedCategory feedCategory = feedCategoryService.findById(
|
FeedCategory feedCategory = feedCategoryService.findById(
|
||||||
getUser(), Long.valueOf(id));
|
getUser(), Long.valueOf(id));
|
||||||
List<FeedCategory> childrenCategories = feedCategoryService
|
if (feedCategory != null) {
|
||||||
.findAllChildrenCategories(getUser(), feedCategory);
|
List<FeedCategory> childrenCategories = feedCategoryService
|
||||||
entries.getEntries().addAll(
|
.findAllChildrenCategories(getUser(), feedCategory);
|
||||||
buildEntries(childrenCategories, subMapping, offset,
|
entries.getEntries().addAll(
|
||||||
limit, unreadOnly));
|
buildEntries(childrenCategories, subMapping,
|
||||||
entries.setName(feedCategory.getName());
|
offset, limit, unreadOnly));
|
||||||
|
entries.setName(feedCategory.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user