Skip to content
Snippets Groups Projects
Commit 6d797c7b authored by srosse's avatar srosse
Browse files

OO-581: check if the feed really exists before indexing it

parent 0480e7d1
No related branches found
No related tags found
No related merge requests found
......@@ -57,16 +57,17 @@ public abstract class FeedRepositoryIndexer extends DefaultIndexer {
logDebug("Indexing: " + repoEntryName);
}
Feed feed = FeedManager.getInstance().getFeed(repositoryEntry.getOlatResource());
// Only index items. Feed itself is indexed by RepositoryEntryIndexer.
if (isLogDebugEnabled()) {
logDebug("PublishedItems size=" + feed.getPublishedItems().size());
}
for (Item item : feed.getPublishedItems()) {
SearchResourceContext feedContext = new SearchResourceContext(searchResourceContext);
feedContext.setDocumentType(getDocumentType());
OlatDocument itemDoc = new FeedItemDocument(item, feedContext);
indexer.addDocument(itemDoc.getLuceneDocument());
if(feed != null) {
// Only index items. Feed itself is indexed by RepositoryEntryIndexer.
if (isLogDebugEnabled()) {
logDebug("PublishedItems size=" + feed.getPublishedItems().size());
}
for (Item item : feed.getPublishedItems()) {
SearchResourceContext feedContext = new SearchResourceContext(searchResourceContext);
feedContext.setDocumentType(getDocumentType());
OlatDocument itemDoc = new FeedItemDocument(item, feedContext);
indexer.addDocument(itemDoc.getLuceneDocument());
}
}
} catch (NullPointerException e) {
logError("Error indexing feed:" + repoEntryName, e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment