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
|
// and populate it
|
||||||
String name = community.getMetadata("name");
|
String name = community.getMetadata("name");
|
||||||
doc.add(new Field("name", name, Field.Store.YES, Field.Index.TOKENIZED));
|
|
||||||
doc.add(new Field("default", name, Field.Store.YES, Field.Index.TOKENIZED));
|
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;
|
return doc;
|
||||||
}
|
}
|
||||||
@@ -848,9 +852,13 @@ public class DSIndexer
|
|||||||
|
|
||||||
// and populate it
|
// and populate it
|
||||||
String name = collection.getMetadata("name");
|
String name = collection.getMetadata("name");
|
||||||
doc.add(new Field("name", name, Field.Store.YES, Field.Index.TOKENIZED));
|
|
||||||
doc.add(new Field("default", name, Field.Store.YES, Field.Index.TOKENIZED));
|
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;
|
return doc;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user