forked from Archives/Athou_commafeed
prevent NPE
This commit is contained in:
@@ -15,13 +15,17 @@ public class FeedEntryService {
|
|||||||
|
|
||||||
public void markEntry(User user, Long entryId, boolean read) {
|
public void markEntry(User user, Long entryId, boolean read) {
|
||||||
FeedEntryStatus status = feedEntryStatusDAO.findById(user, entryId);
|
FeedEntryStatus status = feedEntryStatusDAO.findById(user, entryId);
|
||||||
status.setRead(read);
|
if (status != null) {
|
||||||
feedEntryStatusDAO.update(status);
|
status.setRead(read);
|
||||||
|
feedEntryStatusDAO.update(status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void starEntry(User user, Long entryId, boolean starred) {
|
public void starEntry(User user, Long entryId, boolean starred) {
|
||||||
FeedEntryStatus status = feedEntryStatusDAO.findById(user, entryId);
|
FeedEntryStatus status = feedEntryStatusDAO.findById(user, entryId);
|
||||||
status.setStarred(starred);
|
if (status != null) {
|
||||||
feedEntryStatusDAO.update(status);
|
status.setStarred(starred);
|
||||||
|
feedEntryStatusDAO.update(status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user