mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
Guarding Community and Collection names from causing NPEs in DSIndexer when null.
git-svn-id: http://scm.dspace.org/svn/repo/trunk@2042 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -823,8 +823,12 @@ public class DSIndexer
|
||||
|
||||
// and populate it
|
||||
String name = community.getMetadata("name");
|
||||
|
||||
if(name != null)
|
||||
{
|
||||
doc.add(new Field("name", name, Field.Store.YES, Field.Index.TOKENIZED));
|
||||
doc.add(new Field("default", name, Field.Store.YES, Field.Index.TOKENIZED));
|
||||
}
|
||||
|
||||
return doc;
|
||||
}
|
||||
@@ -848,8 +852,12 @@ public class DSIndexer
|
||||
|
||||
// and populate it
|
||||
String name = collection.getMetadata("name");
|
||||
|
||||
if(name != null)
|
||||
{
|
||||
doc.add(new Field("name", name, Field.Store.YES, Field.Index.TOKENIZED));
|
||||
doc.add(new Field("default", name, Field.Store.YES, Field.Index.TOKENIZED));
|
||||
}
|
||||
|
||||
return doc;
|
||||
|
||||
|
Reference in New Issue
Block a user