prevent NPE

This commit is contained in:
Athou
2013-05-23 11:30:57 +02:00
parent 8f43d8d1bd
commit 2bbfb6e3de

View File

@@ -15,13 +15,17 @@ public class FeedEntryService {
public void markEntry(User user, Long entryId, boolean read) {
FeedEntryStatus status = feedEntryStatusDAO.findById(user, entryId);
status.setRead(read);
feedEntryStatusDAO.update(status);
if (status != null) {
status.setRead(read);
feedEntryStatusDAO.update(status);
}
}
public void starEntry(User user, Long entryId, boolean starred) {
FeedEntryStatus status = feedEntryStatusDAO.findById(user, entryId);
status.setStarred(starred);
feedEntryStatusDAO.update(status);
if (status != null) {
status.setStarred(starred);
feedEntryStatusDAO.update(status);
}
}
}