mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-10 14:11:25 +00:00
[ACS-9073] address review comments
This commit is contained in:
@@ -352,12 +352,15 @@ public class AlfrescoSolrHighlighter extends DefaultSolrHighlighter implements P
|
|||||||
if (highlightFieldEntry.getValue() instanceof String[])
|
if (highlightFieldEntry.getValue() instanceof String[])
|
||||||
{
|
{
|
||||||
String [] snippets = (String[])highlightFieldEntry.getValue();
|
String [] snippets = (String[])highlightFieldEntry.getValue();
|
||||||
if (snippets.length > 0)
|
if (snippets != null && snippets.length > 0 && snippets[0] != null)
|
||||||
{
|
{
|
||||||
if (snippets[0].charAt(0) == '\u0000')
|
if (snippets[0].charAt(0) == '\u0000')
|
||||||
{
|
{
|
||||||
int pos = snippets[0].indexOf('\u0000',1);
|
int pos = snippets[0].indexOf('\u0000',1);
|
||||||
snippets[0] = snippets[0].substring(pos + 1);
|
if(pos != -1)
|
||||||
|
{
|
||||||
|
snippets[0] = snippets[0].substring(pos + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user